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

ban*_*ing 1 cllocationmanager ios

我正在尝试实现一个CLLocationManager到我的应用程序,我得到以下编译时错误.

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

self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
self.locationManager.desiredAccuracy = kCLLocationAccuracyBest;
Run Code Online (Sandbox Code Playgroud)

错误:

_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
Run Code Online (Sandbox Code Playgroud)

Him*_*ury 8

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