在 iOS8 下,它改由 requestWhenInUseAuthorization 來詢問權限
if (nil == locationManager) { locationManager = [[CLLocationManager alloc] init]; } if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) [locationManager requestWhenInUseAuthorization];
另外,要在 info.plist 設定詢問權限時的字串 NSLocationWhenInUseUsageDescription
這樣在詢問的對話框就會出現上面設定的字串了