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 ...
随机推荐
- linux c遍历文件夹 和文件查找的方法
linux c遍历文件夹的方法比较简单,使用c来实现 #include <iostream> #include <stdio.h> #include <sys/types ...
- [CODEVS1037]取数游戏
N(2 <=N<=200,且为偶数)个正整数的序列放在一个游戏平台上,A.B两人轮流从序列的两端取数,取数后该数字被去掉并累加到本玩家的得分中,当数取尽时,游戏结束.以最终得分多者为胜(A ...
- 动态链接库DLL
函数和数据被编译进一个二进制文件(通常扩展名为.LIB). 静态库: 在使用静态库的情况下,在编译链接可执行文件时,链接器从库中复制这些函数和数据并把它们和应用程序的其它模块组合起来创建最终的可执行文 ...
- C++中构造函数和析构函数调用的时机
今天看书忽然对这个地方有点模糊,尤其是析构函数在调用默认的析构函数和用户自己覆写的析构函数的时候有点意识模糊呢.写段代码总结下 #include <iostream> using name ...
- HW5.18
public class Solution { public static void main(String[] args) { System.out.printf("%s\t%s\n&qu ...
- POJ1401 - Factorial
题目大意 N!末尾0的个数 题解 0只能由2*5产生,所以只要求2,5有多少对即可,又因为10!中5的个数少于2,所以只要求因子5有多少个即可,答案即为N/5+N/25+N/125.. 代码: #in ...
- List使用Foreach 修改集合时,会报错的解决方案 (Error: Collection was modified; enumeration operation may not execute. ) - 摘自网络
当用foreach遍历Collection时,如果对Collection有Add或者Remove操作时,会发生以下运行时错误: "Collection was modified; enume ...
- (一)Redis初学教程之安装篇
1.下载windows下Redis服务安装程序(有32位的和64位的,识操作系统安装) 下载地址:https://github.com/dmajkic/redis/downloads 2.安装教程(详 ...
- iOS开发中使用CIDetector检测人脸
在iOS5 系统中,苹果就已经有了检测人脸的api,能够检测人脸的位置,包括左右眼睛,以及嘴巴的位置,返回的信息是每个点位置.在 iOS7中,苹果又加入了检测是否微笑的功能.通过使用 CIDetect ...
- 20169210《Linux内核原理与分析》第十一周作业
第17章 设备与模块 关于设备驱动和设备管理,讨论四种内核成分. 设备类型:在所有的linux系统中为了统一普遍设备的操作所分的类. 模块:Linux内核中用于按需加载和卸载目标码的机制. 内核对象: ...