我想從下面的didUpdateToLocation方法調用方法。在我的buttonUpdate方法中,我正在更新接口,並試圖避免如果將代碼塊直接放在didUpdateToLocation方法中會引起的延遲。出於某種原因,下面的代碼導致我的應用程序崩潰。有誰知道爲什麼?謝謝!performSelectorOnMainThread嵌入在didUpdateToLocation
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation
*)newLocation fromLocation:(CLLocation *)oldLocation {
NSLog(@"didUpdateToLocation: %@", newLocation);
CLLocation *currentLocation = newLocation;
if (currentLocation != nil) {
[self performSelectorOnMainThread:@selector(buttonUpdate:) withObject:nil
waitUntilDone:NO];
}
}
什麼*是*崩潰? –
你可以把崩潰日誌 – IronMan