Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone: [super viewDidUnload] calling order

Tags:

I would like to know if there is any difference between calling [super viewDidUnload] before realeasing properties or after it.

Thank you!

  self.webView = nil;   self.fullText = nil;   [super viewDidUnload]; 

or

  [super viewDidUnload];   self.webView = nil;   self.fullText = nil; 
like image 458
arielcamus Avatar asked Mar 02 '10 17:03

arielcamus


2 Answers

This depends on what the superclass does in viewDidUnload. If it's just a standard UIViewController, either will do because -[UIViewController viewDidUnload] does nothing.

like image 88
rpetrich Avatar answered Oct 04 '22 14:10

rpetrich


I never thought it mattered, but we just found a bug where the app crashed calling it first. The trend at my office has been to call it last, but the Apple template puts it first.

You can do what you want, but I will always call it last from now on.

like image 27
ZaBlanc Avatar answered Oct 04 '22 14:10

ZaBlanc