我正在尝试在我的应用程序中实现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

最佳答案

您可能尚未在Frameworks文件夹中添加CoreLocation.framework。结果,链接器找不到CLLocationManager类。

关于ios - 尝试实现CLLocationManager:获取编译时错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/6011616/

10-11 21:47