1. 程式人生 > >locationManager 回撥方法不呼叫問題?

locationManager 回撥方法不呼叫問題?

當locationManager都設定好了後開始定位服務後回撥方法didUpdateToLocation不呼叫

[_locationManagersetDelegate:self];

 [_locationManagerstartUpdatingLocation];

結果花了幾個小時發現我是在非主執行緒裡呼叫定位,在main thread裡呼叫就ok了

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation

*)oldLocation