定位

Xcode6高德地图定位注意事项

分类: iOS开发

再配置后工程后做如下几件事:

一、在plist中加两句(如图一):

NSLocationWhenInUseUsageDescription

NSLocationAlwaysUsageDescription

二、在UserLocationViewController中加三句(如图二):

    locationManager =[[CLLocationManager alloc] init];
    [locationManager requestAlwaysAuthorization];//用这个方法,plist中需要NSLocationAlwaysUsageDescription
    [locationManager requestWhenInUseAuthorization];//用这个方法,plist里要加字段NSLocationWhenInUseUsageDescription

定位_第1张图片


图二:

定位_第2张图片

三、获得经纬度:

定位_第3张图片

你可能感兴趣的:(定位)