美文网首页
iOS 8设置CLLocation授权

iOS 8设置CLLocation授权

作者: BigPlane | 来源:发表于2015-07-04 23:34 被阅读0次

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

    // 获取授权

    if ([UIDevice currentDevice].systemVersion.doubleValue >= 8.0)

    {

        // 始终允许访问位置信息

        // [_manager requestAlwaysAuthorization];

        // 使用应用程序期间允许访问位置信息

        [_manager requestWhenInUseAuthorization];

    }

相关文章

网友评论

      本文标题:iOS 8设置CLLocation授权

      本文链接:https://www.haomeiwen.com/subject/rzsyqttx.html