‘authorizationStatus’ is deprecated: first deprecated in iOS 14.0
Replace ‘authorizationStatus’ with ‘authorizationStatus’
我们的app系统最低支持ios14.0
出问题的代码:文章来源:https://www.toymoban.com/news/detail-567702.html
- (BOOL)isUserOpenLocationFunction
{
CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
if (status == kCLAuthorizationStatusNotDetermined || status == kCLAuthorizationStatusRestricted || status == kCLAuthorizationStatusDenied) {
return NO;
}
return YES;
}
修改后的代码:文章来源地址https://www.toymoban.com/news/detail-567702.html
- (BOOL)isUserOpenLocationFunction
{
if(!self.manager)
{
self.manager = [[CLLocationManager alloc] init];
self.manager.delegate = self;
}
CLAuthorizationStatus status = self.manager.authorizationStatus;//ios 14及之前后使用 [CLLocationManager locationServicesEnabled]; ios 14及之前使用
if (status == kCLAuthorizationStatusAuthorizedAlways || status == kCLAuthorizationStatusAuthorizedWhenInUse) {
return YES;
}
return NO;
}
到了这里,关于‘authorizationStatus‘ is deprecated: first deprecated in iOS 14.0的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!