views:

44

answers:

2

I've been looking at many code samples on the internet. If I add an UIWebView from interface builder as an IBOutlet. Is it right that in the dealloc method of the controller, I need to do the following?

[webView stopLoading];
webView.delegate = nil;
[webView release];

and what about in the viewDidUnload method?

A: 

That is an appropriate way to handle that.

Daniel A. White
what about in the viewDidUnload method
Taho
Most of the code I've done, I've never used `viewDidUnload`.
Daniel A. White
A: 

In the UIViewController class reference, Apple recommends that for iOS 3.0 and above, you release references to objects that cannot be easily recreated.

In the same document Apple also recommends that you release these references in dealloc.

The relevant method documentation is in the viewDidUnload section of the class reference; it lays this all out in detail and covers both viewDidUnload and dealloc.

GregInYEG