CLLocationmanager delegate method is not working in xcode6 [duplicate]

我只是一个虾纸丫 提交于 2019-12-04 07:17:35

If you're testing this on iOS 8 device / Simulator, old location code may not work because of the way the iOS 8 handles Location Services permission access. As of current iOS 8 beta, you need to use new -requestWhenInUseAuthorization method:

- (void)updateCurrentLocation {

    if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
        [self.locationManager requestWhenInUseAuthorization];
    }

    [self.locationManager startUpdatingLocation];
}

The user prompt contains the text from the NSLocationWhenInUseUsageDescription key in your app’s Info.plist file, and the presence of that key is required when calling this method.

<key>NSLocationWhenInUseUsageDescription</key>
<string>We use your location to find places near you.</string>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!