更新时间:2023-02-06 13:02:47
从IOS 8起,您需要在启动CLLocationManager之前请求授权。
Since IOS 8 you need to ask for authorization before starting the CLLocationManager.
您是否正在调用其中一种方法?
Are you calling one of these methods?
[self.locationManager requestWhenInUseAuthorization]; // For foreground access
[self.locationManager requestAlwaysAuthorization]; // For background access
如果您在XCode 6之前创建了项目,则可能还需要添加新权限的info.plist条目。
If you have created the project before XCode 6, you probably also need to add the info.plist entry for the new permission.
有关详细信息,请查看此帖:位置服务在iOS 8中无效
For more details have a look at this post: Location Services not working in iOS 8