‘authorizationStatus‘ is deprecated: first deprecated in iOS 14.0

简介: ‘authorizationStatus‘ is deprecated: first deprecated in iOS 14.0

‘authorizationStatus’ is deprecated: first deprecated in iOS 14.0

Replace ‘authorizationStatus’ with ‘authorizationStatus’

我们的app系统最低支持ios14.0

出问题的代码:

- (BOOL)isUserOpenLocationFunction
{
    CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
    if (status == kCLAuthorizationStatusNotDetermined || status == kCLAuthorizationStatusRestricted || status == kCLAuthorizationStatusDenied) {
        return NO;
    }
    return YES;
}

修改后的代码:

- (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;
}
目录
相关文章
|
小程序 JavaScript API
Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ?
Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ?
886 0
|
XML API Android开发
Android’s PreferenceActivity for all API versions
Android’s PreferenceActivity for all API versions
70 0
|
API Python
全网首发:warning: #warning “Using deprecated NumPy API, disable it by “ “#defining NPY_NO_DEPRECATED_API
全网首发:warning: #warning “Using deprecated NumPy API, disable it by “ “#defining NPY_NO_DEPRECATED_API
319 0
|
JSON 前端开发 JavaScript
iOS Principle:Runtime(下)
iOS Principle:Runtime(下)
105 0
iOS Principle:Runtime(下)
|
缓存 编译器 Swift
iOS Principle:Runtime(中)
iOS Principle:Runtime(中)
186 0
iOS Principle:Runtime(中)
|
存储 缓存 编译器
iOS Principle:Runtime(上)
iOS Principle:Runtime(上)
124 0
iOS Principle:Runtime(上)
mTabLayout.setOnTabSelectedListener is deprecated
mTabLayout.setOnTabSelectedListener is deprecated
153 0
mTabLayout.setOnTabSelectedListener is deprecated
|
API
'getWidth()' is deprecated,'getHeight()' is deprecated
'getWidth()' is deprecated,'getHeight()' is deprecated
159 0
'getWidth()' is deprecated,'getHeight()' is deprecated
|
API
'setBackgroundDrawable()' is deprecated,setBackgroundDrawable过时
'setBackgroundDrawable()' is deprecated,setBackgroundDrawable过时
170 0
'setBackgroundDrawable()' is deprecated,setBackgroundDrawable过时
|
Android开发
Android studio更新后出现警告:Warning:The `android.dexOptions.incremental` property is deprecated and it has
Android studio更新后出现警告:Warning:The `android.dexOptions.incremental` property is deprecated and it has