用我的viewDidLoad
方法
locationManager = [[CLLocationManager alloc]init]; // initializing locationManager
locationManager.delegate = self; // we set the delegate of locationManager to self.
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLocation];
if([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) {
[locationManager requestWhenInUseAuthorization];
}
并调用了请求,但未提示用户?为什么?
if([locationManager respondsToSelector:@selector(requestWhenInUseAuthorization:)])