Xcode6下iOS8地图无法定位问题Trying to start MapKit location updates without prompting for location authorizat
来源:互联网 发布:warframe下载数据损坏 编辑:程序博客网 时间:2024/06/06 05:07
报错说明:Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first.
解决办法:
1.首先要链接两个framework
MapKit.framework
CoreLocation.framework;
2.示例代码如下
@interface ViewController : UIViewController
{
CLLocationManager *locationManager;
}@property (weak, nonatomic) IBOutlet MKMapView *mapView;
@end
@implementation ViewController
– (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
locationManager = [[CLLocationManager alloc] init];
[locationManager requestWhenInUseAuthorization];
[locationManager startUpdatingLocation];
[_mapView setShowsUserLocation:YES];
}
NSLocationAlwaysUsageDescription 和 NSLocationWhenInUseDescription
如果还是无法定位当前位置再加上一个字段
Supported interface orientations
- Xcode6下iOS8地图无法定位问题Trying to start MapKit location updates without prompting for location authorizat
- Trying to start MapKit location updates without prompting for location authorization. Must call -[CL
- 运行出现:Trying to start MapKit location updates without prompting for location authorization.
- shows user location在iOS8上不能使用地图定位
- shows user location在iOS8上不能使用地图定位
- iOS8 location 问题
- Core Location定位和MapKit视图使用
- IOS8下,百度地图无法定位解决办法
- 百度地图定位无法获取location的经纬度
- 百度地图SDK定位Location
- IOS学习之Core Location定位和MapKit视图使用
- iOS8 地图定位问题
- IOS8下,百度地图无法定位解决办法,亲测可用
- location 定位
- 高德地图api之location定位
- iOS8 高德地图SDK MAMapView无法定位的问题
- iOS8 高德地图SDK MAMapView无法定位的问题
- iOS8 高德地图SDK MAMapView无法定位的问题
- 修改mysql中root的初始化密码
- hdoj 1058 Humble Number
- php 封装alert方法
- Java操作excel的综合应用(jxl)
- RPM方式安装MySQL5.6
- Xcode6下iOS8地图无法定位问题Trying to start MapKit location updates without prompting for location authorizat
- 日期转string类型
- eMule学习笔记一
- JVM GC log file configuration
- linux 解压/压缩 常用命令
- Text Justification
- 关于浮点数实际值和默认值
- android-support-v4 v7 v13的区别
- 编程接口