ios8地图开发的报错
报错如下:Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first.
网上一搜大把类似的帖子
解决办法:在工程的info.plist文件里面添加两项属性。value值为yes
NSLocationWhenInUseUsageDescription
NSLocationAlwaysUsageDescription
代码里面写:
_locationManager=[[CLLocationManager alloc]init];
if(![CLLocationManager locationServicesEnabled]||[CLLocationManager authorizationStatus]!=kCLAuthorizationStatusAuthorizedWhenInUse){
[_locationManager requestWhenInUseAuthorization];
}
[_locationManager setDelegate:self];
[_locationManager requestAlwaysAuthorization]; //NSLocationAlwaysUsageDescription
[_locationManager requestWhenInUseAuthorization]; //NSLocationWhenInUseDescription
ios8地图开发的报错的更多相关文章
- 【转】 IOS开发xcode报错之has been modified since the precompiled header was built
本文转载自 IOS开发xcode报错之has been modified since the precompiled header was built 其实我是升级xcode到4.6.3的时候遇到的 ...
- IOS开发 xcode报错之has been modified since the precompiled header was built
转载的文章 很实用 IOS开发xcode报错之has been modified since the precompiled header was built 今天做百度地图的时候第一次发现下面错误 ...
- 高德地图Demo运行报错 com.android.ide.common.process.ProcessException: Failed to execute aapt
最近由于有需求去做导航方面的Android开发,很是无奈,以前也的确是没有搞过,领导开大会当着所有人的面说这是给我分配的第一个工作,无论如何要做好,突然间感觉压力好大,自己已经多年没有敲过代码,而且A ...
- hadoop项目开发运行报错(log4j:WARN No appenders could be found for logger (org.apache.hadoop.metrics2.lib.MutableMetricsFactory).)
使用hadoop+myeclipse开发项目是测试运行报错: log4j:WARN No appenders could be found for logger (org.apache.hadoop. ...
- Vue tools开发工具报错Cannot read property '__VUE_DEVTOOLS_UID__' of undefined
使用 vue tools 开发工具,不显示调试面板中的组件,点击控制台报错: Cannot read property 'VUE_DEVTOOLS_UID' of undefined 在 main.j ...
- iOS开发编译报错、常见问题(实时更新)
一.报错与警报 1.错误代码:No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCH ...
- win7+IE11 中开发工具报错occurredJSLugin.3005解决办法
系统环境 win7+IE11 报错描述: Exception in window.onload: Error: An error has ocurredJSPlugin.3005 Stack Trac ...
- iOS 开发笔记-报错处理
1.xcode7报错:does not contain bitcode 解决方法:Build Settings 搜索 bitcode 将Enable Bitcode更改为NO即可 2.Code Si ...
- iOS开发——打包报错error: linker command failed with exit code 1
真机运行没问题,打包报错: clang: error: linker command failed with exit code 1 (use -v to see invocation) 原因:在Xc ...
随机推荐
- 【CSS】Beginner1:Applying CSS
CSS(Cascading Style Sheets) 1.Applying CSS Three ways: 1.In-line 2.Internal 3.External 2.In-line ...
- Java笔记(十五)……面向对象IV多态(polymorphism)
概述 定义:某一类事物的多种存在形态. 例:动物中猫,狗. 猫这个对象对应的类型是猫类型 猫 x = new 猫(); 同时猫也是动物中的一种,也可以把猫称为动物. 动物 y = new 猫(); 动 ...
- 【解决】Oracle服务器ip地址被占用
数据库服务器ip地址被占用,怎么破?! 服务器: 1.改服务器ip: 2.改tnsnames.ora里配置的Oracle数据库ip: 3.重启Oracle服务: 客户端: 1.改tnsnames.or ...
- Yii 图片FTP批量上传 并生成缩略图
图片批量上传,前台使用 uploadify.swf,这个就不介绍了.这里使用两个扩展,一个是FTP上传的扩展,还有一个是生成缩略图的扩展地址:http://www.yiiframework.com/e ...
- [五]JFreeChart实践四之直线图
重点: 1.时间序列集合作为dataset,一个时间序列为一条折线 2.时间序列可以是月:年,小时:天 3.准备好时间序列要放入时间序列集合中 4.将时间序列集合作为dataset传入ChartFac ...
- 一个疑难bug的解决过程
一个crontab脚本,下载一个文件并把内容入mysql数据库.具体流程如下: 1, wget一个文件. 2,处理文件生成一个中间文件. 3,将中间文件load入库. 05 10 * * * /hom ...
- Spring Cloud介绍 Spring Cloud与Dubbo对比
spring Cloud是一个基于Spring Boot实现的云应用开发工具,它为基于JVM的云应用开发中的配置管理.服务发现.断路器.智能路由.微代理.控制总线.全局锁.决策竞选.分布式会话和集群状 ...
- @ContextConfiguration注解说明
@ContextConfiguration Spring整合JUnit4测试时,使用注解引入多个配置文件单个文件 @ContextConfiguration(Locations="../ap ...
- 单位内部DNS架设及域名解析服务
越来越多的企业将企业内部局域网通过光缆.交换机等高速互连设备连接起来,形成较大规模的中型网络,网络上的主机和用户也随之日渐增多.作为 Internet的缩影,企业内部网上的各类服务器(如WWW服务器. ...
- java中synchronized使用方法
synchronized的一个简单样例 public class TextThread { /** * @param args */ public static void main(String[ ...