【发布时间】:2014-12-07 21:57:42
【问题描述】:
像其他所有人一样,当他们升级到 iOS8 时,他们的 CLLocationManager 应用程序开始无法运行。我已经阅读了该主题并认为我已经应用了修复程序,但仍然没有调用 locationManager。我显然错过了一些东西......
#define IS_OS_8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)
- (void)viewDidLoad {
[super viewDidLoad];
locationManager = [[CLLocationManager alloc] init];
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyNearestTenMeters;
locationManager.distanceFilter = 10;
if(IS_OS_8_OR_LATER) {
[locationManager requestAlwaysAuthorization];
NSLog(@"iOS8");
}
[locationManager startUpdatingLocation]; }
【问题讨论】:
-
你可以找到答案on StackOverflow