locationManager = [[CLLocationManager alloc] init];
locationManager.delegate= self;
if([locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
[locationManager requestWhenInUseAuthorization];
}
plist 也配了 NSLocationWhenInUseDescription
模拟器和真机都不弹位置请求框了,真机进到设置里手动开启才行
...
locationManager.delegate= self;
if([locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
[locationManager requestWhenInUseAuthorization];
}
plist 也配了 NSLocationWhenInUseDescription
模拟器和真机都不弹位置请求框了,真机进到设置里手动开启才行
...