今天在XCode6上打开以前写的地图时,给我报这个错 location authorization
ios
去网上查了一番,才知道Xcode6对地图的设置稍有修改
在stackoverflow上找到了答案 iOS 8 : Location Services not working.net
我权当翻译一遍,记录一下.翻译
解决这个问题通常两个步骤。code
> <key>NSLocationWhenInUseUsageDescription</key> <string>The spirit of stack overflow is coders helping coders</string> <key>NSLocationAlwaysUsageDescription</key> <string>I have learned more on stack overflow than anything else</string>
value值随意填,会在请求用户受权时,显示给用户.ip
if ([self.locationManager respondsToSelector:@selector(requestWhenInUseAuthorization)]) { [self.locationManager requestWhenInUseAuthorization]; } [self.locationManager startUpdatingLocation];至于这个就看以前填的是哪一个,永久仍是每次都须要受权
requestWhenInUseAuthorization
get
另,英文还能够的推荐直接看这篇,讲解的很好Core Location Manager Changes in iOS 8string