中提示大量時間,有時在安裝應用程序時,位置權限提示會打開大量時間並掛起所有應用程序,無法進一步移動。位置權限對話框會在iOS 10的iOS 10
這裏是我的代碼iOS的10
-(void)startLocationManager{
self.locationManager=[[CLLocationManager alloc]init];
self.locationManager.desiredAccuracy=kCLLocationAccuracyBest;
self.locationManager.delegate=self;
if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
[self.locationManager requestWhenInUseAuthorization];
}
[self.locationManager startUpdatingLocation];
}
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations{
if (self.myCurrentLocation==nil) {
self.myCurrentLocation=[locations lastObject];
[[WALocationManager WALocationSharedInstance] checkLatestLocation];
}
else{
if (self.myCurrentLocation.horizontalAccuracy < 0){
return;
}
self.myCurrentLocation=[locations lastObject];
if([[WALocationManager WALocationSharedInstance] currentLocation]!=self.myCurrentLocation){
}
}
}
在我的plist文件之前的作品,
<key>NSLocationAlwaysUsageDescription</key>
<string>This app will use your location to get most nearyby activity around you.</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>This app will use your location.</string>
,你在的appdelegate叫這個startLocationManager –
@ Anbu.Karthik .. didlaunch –
您可以將您的項目 –