开发者社区> 问答> 正文

关于iOS 获取不到定位权限问题

iOS 我在做定位的时候 无法获取定位权限。info文件中的字段已经加了,始终拿不到,一直提示

 Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first.

有没有那个大神知道解决办法

展开
收起
爵霸 2016-03-06 08:40:42 3023 0
1 条回答
写回答
取消 提交回答
  • xcode 提示你引用这两个方法了啊

    [CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization]

    授权:

     CLLocationManager  * locationManager = [[CLLocationManager alloc] init];  
                [locationManager requestAlwaysAuthorization];  
                [locationManager requestWhenInUseAuthorization];  
    2019-07-17 18:53:55
    赞同 展开评论 打赏
问答分类:
问答标签:
问答地址:
问答排行榜
最热
最新

相关电子书

更多
手淘iOS性能优化探索 立即下载
From Java/Android to Swift iOS 立即下载
深入剖析iOS性能优化 立即下载