IOS8 位置服务不启动问题
2014-12-26 15:54
239 查看
IOS App定位服务在IOS7中正常,IOS8中打开
原因:
在IOS8中新增了 requestAlwaysAuthorization 和 requestWhenInUseAuthorization 方法,需要将他们添加到info.plist文件中。但是xcode6没有默认添加,用编辑器打开info.plist文件,添加
string标签中间根据需要添加相应的提示文字。
然后调用打开地址位置时 如下
requestAlwaysAuthorization 与 startUpdatingLocation 主要区别为是否在后台可以获取地理位置,具体区别在该方法头文件中有写。
原文地址:http://xujiangtao.com/?p=245
MapKit时没有弹出位置验证提示并且didUpdateLocations代理方法也不调用。
原因:
在IOS8中新增了 requestAlwaysAuthorization 和 requestWhenInUseAuthorization 方法,需要将他们添加到info.plist文件中。但是xcode6没有默认添加,用编辑器打开info.plist文件,添加
<key>NSLocationWhenInUseUsageDescription</key> <string></string> <key>NSLocationAlwaysUsageDescription</key> <string></string>
string标签中间根据需要添加相应的提示文字。
然后调用打开地址位置时 如下
#define IS_OS_8_OR_LATER ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) //In ViewDidLoad if(IS_OS_8_OR_LATER) { [self.locationManager requestAlwaysAuthorization]; } [self.locationManager startUpdatingLocation];
requestAlwaysAuthorization 与 startUpdatingLocation 主要区别为是否在后台可以获取地理位置,具体区别在该方法头文件中有写。
原文地址:http://xujiangtao.com/?p=245
相关文章推荐
- iOS8在隐私中打开某应用的位置服务时设置会crash的问题
- Oracle中的OMS的代理服务启动不了的问题
- Oracle服务启动的问题
- SQL Server 2005报表服务不能启动问题
- 今天解决了BXP4.1在windows server 2003下无法自动启动ardencepxe服务的问题
- workstation服务无法启动问题解决
- NVSvc服务不能启动的问题
- SQL2005报表服务不能启动问题总结报告
- 解决Oracle监听器服务不能启动的问题
- 迅雷将启动收费下载服务 因版权问题屡次被告
- 关于解决WebSphere服务不能启动问题的几点经验总结
- SQL2005报表服务不能启动问题总结报告
- 安装,启动与卸载Mysql系统服务(MYSQL常见问题)
- 解决Oracle监听器服务不能启动的问题
- 服务里Oracle无法启动的问题
- Oracle服务启动的问题
- 安装,启动与卸载Mysql系统服务(MYSQL常见问题)
- ORACLE监听器TNS服务不能启动的问题解决(转自:http://www.cnweblog.com/sunGIS/archive/2006/08/21/124117.html)
- Tomcat 服务不能启动的问题
- “在系统启动时至少有一个服务或驱动程序产生错误”,终于解决这个其实很简单又很烦人的问题