Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should viewDidUnload call super viewDidUnload or dealloc?

The template seems to create [super viewDidUnload] but code samples show:

[super dealloc]

Is there a difference?

like image 691
Blankman Avatar asked Nov 30 '22 09:11

Blankman


1 Answers

You should only invoke the superclass' implementation of -viewDidUnload

Never invoke [super dealloc] directly, except in your own -dealloc method

- (void) viewDidUnload {
    ...
    [super viewDidUnload];
}

And

- (void) dealloc {
    //clean up here
    [super dealloc];
}
like image 145
Jacob Relkin Avatar answered Dec 05 '22 00:12

Jacob Relkin