iOS 设备定位功能可用的判断
if ([CLLocationManager locationServicesEnabled] && ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusAuthorized || [CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined)) { //定位功能可用 CLLocationManager *locationManger = [[CLLocationManager alloc] init]; locationManger.delegate = self; [locationManger startUpdatingLocation]; } else if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusDenied){ NSlog("定位功能不可用"); }
posted on 2016-03-07 14:50 Left-knife 阅读(250) 评论(0) 编辑 收藏 举报