My game is always crashing when a location window pops up.
-(void) MyFunction
{
locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyThreeKilometers;
[locationManager startUpdatingLocation];
}
Whenever it crashes, it returns to main with error EXC_BAD_ACCESS. However, I don't receive any stack trace to find out my problem. Neither the zombie provide stack trace.
One interesting thing is, this crash only happens on the iOS Simulator under release mode. If I change it to debug mode, it works perfectly. If I run it on the devices with release mode, it works perfectly. If I commented out [locationManager startUpdatingLocation], it works perfectly.
How can I resolve this?