尝试实现CLLocationManager:获取编译时错误

时间:2011-05-15 22:12:41

标签: ios cllocationmanager

我正在尝试在我的应用中实现CLLocationManager,并且我收到以下编译时错误。

视图控制器的viewDidLoad方法中的代码:

self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;

错误:

_OBJ_CLASS_$_CLLocationManager," referenced from Obj-c-class-ref in AboutLocationViewController.o

_kCLLocationAccuracyBest," referenced from:
-[AboutLocationViewController viewDidLoad] in AboutLocationViewController.o

Symbol(s)not found for architecture arm7
Collect2: Id returned 1 exit status

1 个答案:

答案 0 :(得分:8)

您可能尚未在Frameworks文件夹中添加CoreLocation.framework。因此,链接器无法找到CLLocationManager类。