iOS8定位问题解决方案
1、修改info
2、CLLocationManager初始化
if([CLLocationManager locationServicesEnabled]){ self.locationManage = [[[CLLocationManager alloc] init] autorelease]; self.locationManage.delegate = self; self.locationManage.distanceFilter = 200; self.locationManage.desiredAccuracy = kCLLocationAccuracyBestForNavigation;//kCLLocationAccuracyBest; if (SYSTEM_VERSION >= 8.0) { //使用期间 [self.locationManage requestWhenInUseAuthorization]; //始终 //or [self.locationManage requestAlwaysAuthorization] } }
3、代理
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status { switch (status) { case kCLAuthorizationStatusNotDetermined: if ([self.locationManage respondsToSelector:@selector(requestAlwaysAuthorization)]) { [self.locationManage requestWhenInUseAuthorization]; } break; default: break; } }
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。