iOS 8设置CLLocation授权

1. 调用CLLocation前, 添加以下代码:

    // 获取授权

    if ([UIDevice currentDevice].systemVersion.doubleValue >= 8.0)
    {
        // 始终允许访问位置信息
        // [_manager requestAlwaysAuthorization]; // manager应为全局变量

        // 使用应用程序期间允许访问位置信息
        [_manager requestWhenInUseAuthorization];
    }

2. 修改info.plist文件:

原文地址:https://www.cnblogs.com/happyplane/p/4703481.html