在我的应用程序中,第一次 reverseGeocoder 结果如下错误块:
didFailWithError:Error Domain=NSURLErrorDomain Code=-1011 “操作无法完成。(NSURLErrorDomain 错误 -1011。)” UserInfo=0x6252100 {PBHTTPStatusCode=503}
这是我使用的代码:
- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation {
geocoder = [[MKReverseGeocoder alloc] initWithCoordinate:newLocation.coordinate];
[geocoder setDelegate:self];
[geocoder start];
[locationManager stopUpdatingLocation];
}
-(void)reverseGeocoder:(MKReverseGeocoder *)geocoder1 didFailWithError:(NSError *)error
{
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:@"iBeen There" message:@"GPS can't track the location please check the internet connection." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
NSLog(@"reverseGeocoder:%@ didFailWithError:%@", geocoder, error);
}
第一次它会出错块(有时)。我错过了什么请帮帮我吗?