1. 调用CLLocation前, 添加以下代码:
// 获取授权
if ([UIDevice currentDevice].systemVersion.doubleValue >= 8.0)
{
// 始终允许访问位置信息
// [_manager requestAlwaysAuthorization];
// 使用应用程序期间允许访问位置信息
[_manager requestWhenInUseAuthorization];
}
![](https://img.haomeiwen.com/i653993/75ef2674ab92a1f5.png)
1. 调用CLLocation前, 添加以下代码:
// 获取授权
if ([UIDevice currentDevice].systemVersion.doubleValue >= 8.0)
{
// 始终允许访问位置信息
// [_manager requestAlwaysAuthorization];
// 使用应用程序期间允许访问位置信息
[_manager requestWhenInUseAuthorization];
}
本文标题:iOS 8设置CLLocation授权
本文链接:https://www.haomeiwen.com/subject/rzsyqttx.html
网友评论