2009-08-05 67 views
0

我想要使用iphone sdk獲取當前位置。下面是代碼:卡住當前位置 - iphone sdk

http://pastie.org/572062

這裏是生成錯誤:

建設目標「Send2iPhone」項目的「Send2iPhone」同構「釋放」 - (2個錯誤) CD /用戶/ pswenson/dev/send2iphone/iphone_code/Send2iPhone setenv MACOSX_DEPLOYMENT_TARGET 10.5 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/gcc-4.2 -arch i386 -isysroo t /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.sdk -L/Users/pswenson/dev/send2iphone/iphone_code/Send2iPhone/build/Release-iphonesimulator -F/Users/pswenson/dev/send2iphone/iphone_code/Send2iPhone/build/Release-iphonesimulator -filelist /Users/pswenson/dev/send2iphone/iphone_code/Send2iPhone/build/Send2iPhone.build/Release-iphonesimulator/Send2iPhone.build/Objects-normal/i386/Send2iPhone.LinkFileList -mmacosx- version-min = 10.5 -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/pswenson/dev/send2iphone/iphone_code/Send2iPhone/build/Release-iphonesimulator/Send2iPhone.app/Send2iPhone 未定義符號: 「.objc_class_name_CLLocationManager」,參考文獻: 文字指針@__ OBJC @__ cls_refs @ DetailViewController.o中的CLLocationManager 「_kCLLocationAccuracyNearestTenMeters」,引用自: _kCLLocationAccuracyNearestTenMeters $ non_lazy_ptr在DetailViewController.o LD:符號(S)沒有發現 collect2:LD返回1退出狀態 「.objc_class_name_CLLocationManager」,從引用: 字面指針@__ OBJC @__ cls_refs @ CLLocationManager在DetailViewController.o 「 _kCLLocationAccuracyNearestTenMeters」,從引用:在DetailViewController.o LD _kCLLocationAccuracyNearestTenMeters $ non_lazy_ptr:符號(S)沒有發現 collect2:LD返回1個退出狀態 構建失敗(2個錯誤)

我無言以對....有任何想法嗎?

回答

2

您是否已將CoreLocation庫添加到項目中?看起來像你有問題的鏈接,這通常意味着你沒有你的項目需要的所有庫。

+0

是的,就是這樣。我有一段時間讓XCode認識到框架,但最終它工作。 謝謝! – 2009-08-05 20:14:55