2011-05-29 90 views
4

我正在使用CLLocationManager。使用iMac的位置管理器

我得到这个编译错误:

Ld /Users/Teguh/Library/Developer/Xcode/DerivedData/BadgerNew-bjopcgcgsjkcvcevflfbvsjwfgnu/Build/Products/Debug-iphonesimulator/BadgerNew.app/BadgerNew normal i386 
    cd /Users/Teguh/Dropbox/badgers/BadgerNew 
    setenv MACOSX_DEPLOYMENT_TARGET 10.6 
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-g++-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/Teguh/Library/Developer/Xcode/DerivedData/BadgerNew-bjopcgcgsjkcvcevflfbvsjwfgnu/Build/Products/Debug-iphonesimulator -F/Users/Teguh/Library/Developer/Xcode/DerivedData/BadgerNew-bjopcgcgsjkcvcevflfbvsjwfgnu/Build/Products/Debug-iphonesimulator -filelist /Users/Teguh/Library/Developer/Xcode/DerivedData/BadgerNew-bjopcgcgsjkcvcevflfbvsjwfgnu/Build/Intermediates/BadgerNew.build/Debug-iphonesimulator/BadgerNew.build/Objects-normal/i386/BadgerNew.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -o /Users/Teguh/Library/Developer/Xcode/DerivedData/BadgerNew-bjopcgcgsjkcvcevflfbvsjwfgnu/Build/Products/Debug-iphonesimulator/BadgerNew.app/BadgerNew 

Undefined symbols for architecture i386: 
    "_OBJC_CLASS_$_CLLocationManager", referenced from: 
     objc-class-ref in UtilitiesQuick.o 
    "_kCLLocationAccuracyBest", referenced from: 
     -[BNUtilitiesQuick init] in UtilitiesQuick.o 
ld: symbol(s) not found for architecture i386 
collect2: ld returned 1 exit status 

所以我怎么到CLLocationmanager编程?我的意思是这是否意味着位置管理器在iMac上不可用?

回答

15

您需要将CoreLocation.framework添加到您的项目。

3

我得到了同样的问题..一个长期的斗争,我发现这个问题..

我解决了这种方式以后。

  1. 转到构建设置
  2. 搜索“框架搜索路径'
  3. 并删除预先填充的路径。

现在,它完美的作品。我已经给出了答案this question ..希望这有助于有人..