в iOS 10, иногда при установке приложения запросы разрешения на доступ открывают много времени и висят все приложение и не могут двигаться дальше.Диалоговое окно разрешения местоположения запрашивает много времени в iOS 10
вот мой код, который работает до того прошивка 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>
где вы назвали этот startLocationManager –
@ Anbu.Karthik в AppDelegate .. didlaunch –
вы можете прикрепить ваш проект –