MapKit/Location Manager crashes app when unloading view

Posted by AppGolfer on Stack Overflow See other posts from Stack Overflow or by AppGolfer
Published on 2010-03-25T04:08:46Z Indexed on 2010/03/25 4:13 UTC
Read the original article Hit count: 419

Filed under:
|
|
|

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];

© Stack Overflow or respective owner

Related posts about mapkit

Related posts about cllocationmanager