【发布时间】:2015-01-27 10:43:45
【问题描述】:
我正在尝试支持 iOS7 和 8 定位服务。当我在我的 iOS8 设备上运行时,我收到了这个错误:
"MyApp depending on legacy on-demand authorization, which is not supported for new apps"
我的 plist 中有一个 when in use 条目。这是我的代码:
if ([_locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
[_locationManager requestWhenInUseAuthorization];
} else {
[_locationManager startUpdatingLocation];
}
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status {
if (status == kCLAuthorizationStatusAuthorizedWhenInUse) {
[_locationManager startUpdatingLocation];
}
}
为什么会出现这个错误?
【问题讨论】:
-
这个错误出现在哪里?
-
这个错误出现在 iOS 模拟器 > 调试 > 系统日志
标签: objective-c ios8 core-location