今天在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