Leg*_*las 0 iphone import cocoa-touch objective-c ios
这是我第一次使用位置服务而且我遇到了这个链接器错误:
体系结构i386的未定义符号:"_ OBJC_CLASS _ $ _ CLLocationManager"
我添加#import <CoreLocation/CoreLocation.h>并添加了以下几行viewDidLoad
CLLocationManager *manager = [[CLLocationManager alloc] init];
manager.delegate = self;
[manager startUpdatingLocation];
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
if (![CLLocationManager locationServicesEnabled]){
UIAlertView *servicesDisabledAlert = [[UIAlertView alloc] initWithTitle:@"Location Services Disabled" message:@"You currently have all location services for this device disabled. If you proceed, you will be asked to confirm whether location services should be reenabled." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[servicesDisabledAlert show];
[servicesDisabledAlert release];
}
[manager release];
Run Code Online (Sandbox Code Playgroud)

| 归档时间: |
|
| 查看次数: |
784 次 |
| 最近记录: |