Xcode6高德地圖定位注意事項

再配置後工程後做如下幾件事:

一、在plist中加兩句(如圖一):

NSLocationWhenInUseUsageDescription

NSLocationAlwaysUsageDescription

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

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


圖二:

三、獲得經緯度:




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章