Tag: mkreversegeocoder

MKReverseGeocoder“在iOS 5中弃用”

它说这是“在iOS 5中弃用”。 – (void)viewDidLoad { [super viewDidLoad]; CLGeocoder *geocoder = [[CLGeocoder alloc] init]; [geocoder reverseGeocodeLocation:self.locationManager.location // You can pass aLocation here instead completionHandler:^(NSArray *placemarks, NSError *error) { dispatch_async(dispatch_get_main_queue() , ^ { // do stuff with placemarks on the main thread CLPlacemark *place = [placemarks objectAtIndex:0]; NSString *zipString = [place.addressDictionary valueForKey:@"ZIP"]; [self performSelectorInBackground:@selector(showWeatherFor:) withObject:zipString]; } } […]

如何处理iOS 4.3中的MKReverseGeocoder / PBHTTPStatusCode = 503错误?

从iOS 4.3(GM种子10M2518)我使用MKReverseGeocoder时崩溃。 reverseGeocoder:didFailWithError:被这样的错误经常调用: Error Domain=NSURLErrorDomain Code=-1011 "The operation couldn't be completed. (NSURLErrorDomain error -1011.)" UserInfo=0x339900 {PBHTTPStatusCode=503} 应用程序往往在这些时刻崩溃。 在以前的iOS版本中,情况并非如此。 任何想法发生了什么?