If I have a viewController setup as below:
@interface MapViewController : UIViewController <MKMapViewDelegate, CLLocationManagerDelegate> {
CLLocationManager *locationManager;
}
-(void)viewDidLoad {
[super viewDidLoad];
locationManager = [[CLLocationManager alloc] init];
}
when it comes to memory management should I be adding release to both viewDidUnload & dealloc?
-(void)viewDidUnload {
[locationManager release];
locationManager = nil;
[super viewDidUnload];
}
-(void)dealloc {
[locationManager release];
[super dealloc];
}
cheers Gary
EDIT:
[super dealloc] moved to bottom as per Deans kind comment.