ios8

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

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

[locationmanager requestAlwaysAuthorization];        
[locationmanager requestWhenInUseAuthorization];  

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

NSLocationAlwaysUsageDescription

NSLocationWhenInUseUsageDescription

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

原文地址:https://www.cnblogs.com/liuliuliu/p/4147241.html