我的问题是在 iOS 8 上无法获取当前位置的纬度和经度。我尝试在 .plist 文件中设置密钥用于 iOS 8,但是没有调用这个方法 - didUpdateToLocation: 请帮忙解决这个问题。
我的代码是:
- (void)viewDidLoad
{
[super viewDidLoad];
self.locationManager = [[CLLocationManager alloc] init];
self.locationManager.delegate = self;
if(IS_OS_8_OR_LATER) {
//[self.locationManager requestWhenInUseAuthorization];
[self.locationManager requestWhenInUseAuthorization];
[self.locationManager startUpdatingLocation];
}
}