views:

501

answers:

2

Hi,

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;
+1  A: 

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

rpetrich
Oops, didn't see that this was already answered somehow!
Griffo
+2  A: 

This only matters if the superclass of your view actually does something in viewDidLoad. The default UIViewController doesn't do anything in viewDidLoad so if your view is a standard UIViewController then you can put [super viewDidLoad] anywhere in the viewDidLoad method. However, if super does something in viewDidLoad, then it does matter where you put [super viewDidLoad].

Griffo