【发布时间】:2015-10-29 14:24:06
【问题描述】:
我正在使用以下代码来更新位置 - 它在 iOS 9 下运行良好,但在 iOS 9 中出现错误 -
locationManager = [[CLLocationManager alloc] init];
[locationManager setDelegate:self];
[locationManager setDistanceFilter:kCLDistanceFilterNone];
[locationManager setDesiredAccuracy:kCLLocationAccuracyHundredMeters];
if ([locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)])
[locationManager requestWhenInUseAuthorization];
// tried this also -
/* if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 9) {
locationManager.allowsBackgroundLocationUpdates = YES;}*/
[locationManager requestLocation];
didFailWithError: 错误域=kCLErrorDomain Code=0 "(null)"
plist 文件也已完成更改 -
任何人都可以建议我缺少什么?
【问题讨论】:
-
@San007 你能找到任何解决方案吗?我只在 iPad 上遇到这个问题,它在 iPhone 上工作。
-
我也面临同样的问题,,,你找到解决方案了吗
标签: objective-c ios8 cllocationmanager ios9