在xcode6中 蘋果地圖的定位方法修改了,如果直接用以前的將會出現下面這個錯誤:
報錯說明:Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first.
解決辦法:
在Supporting Files下得info.plis裏面添加NSLocationAlwaysUsageDescription 和 NSLocationWhenInUseDescription 兩個String字段,value可以設置成要提示用戶的字符串,如果問題還是不能解決,那就在info.plist中還需要包含Supported interface orientations 這個Array字段。然後運行就解決了