iMac的位置管理器

问题描述

| 我正在使用CLLocationManager。 我收到此编译错误
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上不提供位置管理器?     

解决方法

        您需要在项目中添加
CoreLocation.framework
。     ,        我遇到了同样的问题..经过长时间的努力,我发现了问题.. 我是这样解决的 转到构建设置 搜索“框架搜索路径” 并删除预填充的路径。 现在它可以正常工作了..我已经在这个问题上给出了答案..希望它可以帮助一些人..