Since iOS 4.3 SDK is not in beta anymore, i believe i can talk about it here.
I\'m using UIApplicationExitsOnSuspend
flag in my application to relaunch
This problem is something that has been introduced in the Golden Master since the seeded betas did not have it, and it comes down to the (in my case) reverse geocoder.
Google is sending you a 503 error code (this is pretty standard and it happens when google thinks that you are abusing their service). Since the geocoder is successfull most of the times, the crash seems random, but it isn't. If you want to replicate it, have a proxy (like Charles proxy) returning you 503 and you will see the crash coming every time. Try also disabling location services on your device and you will see that you do not have this problem anymore.
-- Another forum
That's exactly what's happening. I was connected to WiFi when i was experiencing this issue, and when i turned WiFi off, the application didn't crash anymore. It was using GPRS to retrieve the location information, now.
If was used MKReverseGeocoder then be sure that you did not release reverse geocoder at -reverseGeocoder:didFailWithError:
If the problem is this then try to replace [reverseGeocoder release];
to [reverseGeocoder autorelease];
Google doesn't allow a single device to retrieve its location more than once within 60 sec, hence working with another method (http request instead, JSON needed) when (MKReverseGeocoder *)geocoder didFailWithError.
It works for me on 4.3.3 (3GS) and tested for 30-40 times retrieving user's location consecutively without a crash, hope it helps!
- (void) retrieveCurrentLoc {
self.geoCoder =
[[[MKReverseGeocoder alloc] initWithCoordinate:newLocation.coordinate] autorelease];
geoCoder.delegate = self;
[geoCoder start];
}
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error{
NSString *fetchURL = [NSString stringWithFormat:@"http://maps.google.com/maps/geo? q=%@,%@&output=json&sensor=true", [NSString stringWithFormat:@"%f",mapView.userLocation.location.coordinate.latitude], [NSString stringWithFormat:@"%f",mapView.userLocation.location.coordinate.longitude]];
NSURL *url = [NSURL URLWithString:fetchURL];
NSString *htmlData = [NSString stringWithContentsOfURL:url];
SBJsonParser *parser = [[SBJsonParser alloc] init];
NSDictionary *json = [parser objectWithString:htmlData error:nil];
NSArray *placemark = [json objectForKey:@"Placemark"];
if ([[[[[placemark objectAtIndex:0] objectForKey:@"AddressDetails"]objectForKey:@"Country"]objectForKey:@"Thoroughfare"]objectForKey:@"ThoroughfareName"] != NULL){
currentAddress = [[[[[placemark objectAtIndex:0] objectForKey:@"AddressDetails"]objectForKey:@"Country"]objectForKey:@"Thoroughfare"]objectForKey:@"ThoroughfareName"];}
else {
currentAddress = [[placemark objectAtIndex:0] objectForKey:@"address"];
}
}
I had the same problem. The solution is to set the delegate to nil before you release the geocoder. So you should add
[reverseGeocoder setDelegate:nil];
[reverseGeocoder release];
H,
There is enough information for the Exception Type: EXC_BAD_ACCESS (SIGBUS)
Would suggest you to go thought the below link...
http://www.chrisdanielson.com/2009/07/20/iphone-sigbus-issue/