ios8中使用地图已经改变了

ios8以前系统地图定位不好用了,

ios8要使用地图定位,需要设置

第一步,在info.plist表中添加两个字段

NSLocationAlwaysUsageDescription

NSLocationWhenInUseUsageDescription

第二步:直接用第三方框架INTULocationManager

INTULocationManager *mgr = [INTULocationManagersharedInstance];

if (mgr.locationServicesAvailable
== NO) {

return;

}

//
请求位置

[mgr
requestLocationWithDesiredAccuracy:INTULocationAccuracyCitytimeout:10.0block:^(CLLocation
*currentLocation, INTULocationAccuracy achievedAccuracy,
INTULocationStatus status) {

if (status ==
INTULocationStatusSuccess) {
// 请求成功

NSLog(@"ddddddd%f %f",
currentLocation.coordinate.latitude, currentLocation.coordinate.longitude);

}

}];

这样就能使用地图,不论手机的系统是ios几都可以用了

时间: 2024-08-04 05:52:52

ios8中使用地图已经改变了的相关文章

iOS8定位与地图

iOS开发系列--地图与定位 转载:http://www.cnblogs.com/kenshincui/ 概览 现在很多社交.电商.团购应用都引入了地图和定位功能,似乎地图功能不再是地图应用和导航应用所特有的.的确,有了地图和定位功能确实让我们的生活更加丰富多彩,极大的改变了我们的生活方式.例如你到了一个陌生的地方想要查找附近的酒店.超市等就可以打开软件搜索周边;类似的,还有很多团购软件可以根据你所在的位置自动为你推荐某些商品.总之,目前地图和定位功能已经大量引入到应用开发中.今天就和大家一起看

掌握iOS8中的动态文本

原文链接 : Swift Programming 101: Mastering Dynamic Type in iOS 8 原文作者 : Kevin McNeish 译文出自 : 开发技术前线 www.devtf.cn 转载声明: 本译文已授权开发者头条享有独家转载权,未经允许,不得转载! 译者 : kmyhy Apple声称鼓励第三方App能够支持动态文本.但是,如果你尝试在App中实现这个特性,你会发现其中有很多坑(例如静态cell和定制cell样式).在本文中,我们将介绍动态文本的机理以及

ios8中的UIScreen

Java代码   let orientation: UIInterfaceOrientation = UIApplication.sharedApplication().statusBarOrientation println("Currently landscape: " + ((orientation == UIInterfaceOrientation.LandscapeLeft||orientation == UIInterfaceOrientation.LandscapeRig

iOS 学习笔记 九 (2015.04.02)IOS8中使用UIAlertController创建警告窗口

1.IOS8中使用UIAlertController创建警告窗口 #pragma mark - 只能在IOS8中使用的,警告窗口- (void)showOkayCancelAlert{    NSString *title = NSLocalizedString(@"修改组名", nil);    NSString *message = NSLocalizedString(@"请输入新的组名", nil);    NSString *cancelButtonTitl

ios8中百度推送接收不到

ios8中百度推送接收类型会有所改变: //消息推送注册 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNot

iOS8中定位服务的变化(CLLocationManager协议方法不响应,无法回掉GPS方法,不出现获取权限提示)

最近在写一个LBS的项目的时候,因为考虑到适配iOS8,就将项目迁移到Xcode6.0.1上,出现了不能正常获取定位服务权限的问题. self.manger = [[CLLocationManager alloc]init]; self.manger.distanceFilter = kCLDistanceFilterNone; // meters self.manger.delegate = self; [self.manger requestAlwaysAuthorization]; sel

iOS8中的定位服务

My app that worked fine in iOS 7 doesn't work with the iOS 8 SDK. CLLocationManager doesn't return a location, and I don't see my app under Settings > Location Services either. I did a Google search on the issue but nothing came up, what could be wro

WPF中model属性即时改变

新建一个model作为说明即可,以便查阅. 添加引用:using System.ComponentModel ; public class Test:INotifyPropertyChanged { private string name; public string Name { get { return this.name; } set { this.name = value; NotifyPropertyChanged("Name"); } } public event Prop

初探 iOS8 中的 Size Class

以前和安卓的同学聊天的时候,谈到适配一直是一个非常开心的话题,看到他们被各种屏幕适配折磨的欲仙欲死,心里真替他们高兴.不过在做到 iPhone 和 iPad 的适配的时候,一个页面需要配置多个 xib 进行开发还是个很头疼的事情.再加上 iPhone6 和 iPhone6 plus 的发布,适配似乎也变得麻烦起来.今天了解了 iOS8 中的 Size Class 之后,真的笑,笑出声. 简介 先来看一下我们的新伙伴:Size Classes.在 iOS8 中,我们不用再像以前那样,一个页面新建多