码迷,mamicode.com
首页 > 移动开发 > 详细

iOS 8 地图

时间:2014-12-23 13:48:21      阅读:223      评论:0      收藏:0      [点我收藏+]

标签:

iOS8修改了位置设置里的内容,增加了一套状态(使用中可用/通常可用),所以以前的CLLcationManage的注册后,
Delegate接口不响应了。
iOS8需要这么设置

第一步 
location = [[CLLocationManager alloc] init]; 

location.delegate= self; 

[location requestAlwaysAuthorization]; 


第二步 

在Plist中追加下面两个字段 (必须有,最少一个,内容是系统ALert的文言,文言可为空) 
NSLocationWhenInUseDescription
NSLocationAlwaysUsageDescription

第三步 
有了新的Delegate方法。
 
- (void)locationManager:(CLLocationManager *)manager didChangeAuthorizationStatus:(CLAuthorizationStatus)status 
{ 
    switch (status)
    { 
            case kCLAuthorizationStatusNotDetermined: 
            if ([location respondsToSelector:@selector(requestAlwaysAuthorization)]) 
            { 
            [locationrequestAlwaysAuthorization]; 
            } 
            break; 
        default: 
            break;
} }

 

附上调查过程
https://developer.apple.com/jp/devcenter/ios/library/documentation/LocationAwarenessPG.pdf
http://www.w3c.com.cn/ios8新特性之基于地理位置的消息通知uilocalnotification
http://blog.uniba.jp/post/91830563468/ios-8

iOS 8 地图

标签:

原文地址:http://www.cnblogs.com/qianyindichang/p/4179839.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!