在iOS8开发中,发现一个CoreLocation的使用问题,执行操作之后,不会调用到定位之后的delegate方法中。

根据文档,需要在使用CoreLocation前调用方法:

[locationmanager requestAlwaysAuthorization];        
[locationmanager requestWhenInUseAuthorization];  

 

并在Info.plist中加入两个字段(需手动输入添加,无选择项)

NSLocationAlwaysUsageDescription

NSLocationWhenInUseUsageDescription

这两个字段就是自定义提示用户授权使用地理定位功能时的提示语。

相关文章:

  • 2021-12-10
  • 2021-04-24
  • 2022-12-23
  • 2021-10-07
  • 2022-12-23
  • 2021-09-22
  • 2021-11-19
  • 2022-12-23
猜你喜欢
  • 2022-01-07
  • 2022-12-23
  • 2022-02-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
相关资源
相似解决方案