判断当前有无给应用授权定位功能

if ([CLLocationManager locationServicesEnabled] && ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorizedWhenInUse || [CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined || [CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized)) {
        
        //定位功能可用
        NSLog(@"定位功能可用");
        
    } else if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied) {
        
        //定位不能用
        NSLog(@"定位功能不可用");
    }

 

posted @ 2017-01-06 14:52  _Mo  阅读(381)  评论(0编辑  收藏  举报