且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iOS 8 GPS 未启用

更新时间:2022-06-05 01:48:31

对于 IOS 8,您必须将 NSLocationAlwaysUsageDescriptionNSLocationWhenInUseUsageDescription 键添加到您的 plist.否则它不会请求许可.

For IOS 8 you have to add NSLocationAlwaysUsageDescription or NSLocationWhenInUseUsageDescription key to your plist. Otherwise it does not ask for permission.

添加 CLLocationManagerDelegate

add CLLocationManagerDelegate

@implementation Locator <CLLocationManagerDelegate>

- (instancetype) init {
    //......
    self.locationManager.requestAlwaysAuthorization();
}