今天在XCode6上打开之前写的地图时,给我报这个错 location authorization

去网上查了一番,才知道Xcode6对地图的设置稍有修改

在stackoverflow上找到了答案 iOS 8 : Location Services not working

我权当翻译一遍,记录一下.

解决这个问题一般两个步骤。

1 在工程info。plist文件中添加下面值,任意一个

>	<key>NSLocationWhenInUseUsageDescription</key>
<string>The spirit of stack overflow is coders helping coders</string> <key>NSLocationAlwaysUsageDescription</key>
<string>I have learned more on stack overflow than anything else</string>

value值随意填,会在请求用户授权时,显示给用户.

2 接着就在工程中加入这几行代码

      if ([self.locationManager 	respondsToSelector:@selector(requestWhenInUseAuthorization)]) {
  [self.locationManager requestWhenInUseAuthorization];
}
[self.locationManager startUpdatingLocation];

至于这个就看之前填的是哪个,永久还是每次都需要授权

requestWhenInUseAuthorization

另,英文还可以的推荐直接看这篇,讲解的很好Core Location Manager Changes in iOS 8

os8 location authorization 错误.的更多相关文章

  1. myelipse中部署路径deploy location出现错误

    背景: 因java_web项目中的所有代码以及资源文件突然无法提交,在尝试过诸多方法无果后,果断删除项目重新将down下来.启动Tomcat无问题,使用原来的访问连接报错.经检查发现加载至Tomcat ...

  2. The OAuth 2.0 Authorization Framework-摘自https://tools.ietf.org/html/rfc6749

                                                                                  Internet Engineering T ...

  3. Runtime "Apache Tomcat v6.0 (3)" is invalid. The JRE could not be found. Edit the server and change the JRE location解决方案

    使用eclipse,启动Tomcat时出现The JRE could not be found ,Edit server and change teh JRE location的错误提示! 原因:重装 ...

  4. eclipse中安装pydev插件出现duplicate location

    eclipse中安装pydev插件出现duplicate location,主要是因为之前已经填写了该地址并且已经加载了,具体的解决办法见下链接: http://jingyan.baidu.com/a ...

  5. OAuth 2.0 Authorization Framework RFC

    Internet Engineering Task Force (IETF) D. Hardt, Ed.Request for Comments: 6749 MicrosoftObsoletes: 5 ...

  6. The OAuth 2.0 Authorization Framework

      The OAuth 2.0 Authorization Framework Abstract The OAuth 2.0 authorization framework enables a thi ...

  7. 塞翁失马,焉知非福:由 Styles.Render 所引发 runAllManagedModulesForAllRequests="true" 的思考

    最近在使用 MVC 开发的时候,遇到一个对我来说"奇怪的问题",就是使用 BundleTable 进行 CSS.JS 文件绑定,然后使用 Styles.Render.Scripts ...

  8. <modules runAllManagedModulesForAllRequests="true" />(转1)

    最近在使用 MVC 开发的时候,遇到一个对我来说“奇怪的问题”,就是使用 BundleTable 进行 CSS.JS 文件绑定,然后使用 Styles.Render.Scripts.Render 进行 ...

  9. ios 8 地图定位

    在xcode6在 苹果公司定位方法改变地图,谁也无法使用 错误说明:Trying to start MapKit location updates without prompting for loca ...

随机推荐

  1. php5,Apache在windows 7环境搭建

    主要是参考以下文章: http://www.cnblogs.com/Yogurshine/archive/2013/05/24/3097343.html http://jingyan.baidu.co ...

  2. HDOJ 1282 回文数猜想(回文串类)

    Problem Description 一个正整数,如果从左向右读(称之为正序数)和从右向左读(称之为倒序数)是一样的,这样的数就叫回文数.任取一个正整数,如果不是回文数,将该数与他的倒序数相加,若其 ...

  3. my dup2

    #include <fcntl.h>#include <stdio.h>#include <unistd.h> int mydup(int i_OldFd, int ...

  4. POJ_3083——贴左右墙DFS,最短路径BFS

    Description The cornfield maze is a popular Halloween treat. Visitors are shown the entrance and mus ...

  5. HDU5196--DZY Loves Inversions 树状数组 逆序数

    题意查询给定[L, R]区间内 逆序对数 ==k的子区间的个数. 我们只需要求出 子区间小于等于k的个数和小于等于k-1的个数,然后相减就得出答案了. 对于i(1≤i≤n),我们计算ri表示[i,ri ...

  6. css中margin:0 auto没作用

    很多初学制作网页的朋友,可能会遇到的一个常见问题,就是在CSS中加了margin:0 auto;却没有效果,不能居中的问题!margin:0 auto;的意思就是:上下边界为0,左右根据宽度自适应!其 ...

  7. CSS常用操作-图片

    index.html <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> &l ...

  8. TypeScript 素描 - 装饰器

    /* 装饰器 简单理解为C#中的Attribute 可以装饰到类.函数.讯问符.属性.参数上 语法 @xxx 装饰器其实是一个函数 @xxx 就要有一个 function xxx 多个装饰器可以用来装 ...

  9. tcp/ip连接

    1.TCP先连接(三次握手) client -> server : SYN a server -> client :SYN b, ack a+1 client -> server a ...

  10. form表单提交之前推断

    1.使用onsubmit方法 <form name="Form" action="t" method="post" onsubmit= ...