views:

221

answers:

0

I has a bug where my application crashed "EXC_BAD_ACCESS" when I hit the back key on my navigation bar and the view unloaded that had a MapKit (mapView) and used the Location Manager. Tried for days to fix the bug and finally came up with a fix for anyone that comes across this problem:

Add this code to your dealloc

  • (void)dealloc {

    mapView.delegate = nil;

    locationManager.delegate = nil;

    [mapView release];

    [locationManager release];