开发者社区 问答 正文

关于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 3114 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • xcode 提示你引用这两个方法了啊

    [CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization]

    授权:

     CLLocationManager  * locationManager = [[CLLocationManager alloc] init];  
                [locationManager requestAlwaysAuthorization];  
                [locationManager requestWhenInUseAuthorization];  
    2019-07-17 18:53:55 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
问答分类:
问答标签:
问答地址: