What is the best practice to use these two methods for memory management? My current application can easily release its views after a memory warning, because it needs large memory. What do I need to do in these methods? I'm using various nibs in my applications and I'm connecting objects in them to my view controllers without retaining them. Do I need to retain nib objects while loading a view from a nib and why? I see in the documentation things have changed with OS 3.0 and I'm only talking about 3.0
If you are only talking about 3.0 then release any objects that you can easily recreate in viewDidUnload. You can then recreate or reload them from a nib in viewDidLoad. Make sure when you release objects, you ether nil them out or have your setter do that. That way you can use viewDidLoad to check for nil or not before reloading or recreating.
As for loading from nib objects, if you are loading into your properties, and have them set to retain, then you don't have to retain again.
From Apple:
The UIViewController class provides some automatic handling of low-memory conditions through its didReceiveMemoryWarning (page 20) method, which releases unneeded memory. Prior to iPhone OS 3.0, this method was the only way to release additional memory associated with your custom view controller class but in iPhone OS 3.0 and later, the viewDidUnload (page 30) method may be a more appropriate place for most needs. When a low-memory warning occurs, the UIViewController class purges its views if it knows it can reload or recreate them again later. If this happens, it also calls the viewDidUnload method to give your code a chance to relinquish ownership of any objects that are associated with your view hierarchy, including objects loaded with the nib file, objects created in your viewDidLoad (page 29) method, and objects created lazily at runtime and added to the view hierarchy. Typically, if your view controller contains outlets (properties or raw variables that contain the IBOutlet keyword), you should use the viewDidUnload method to relinquish ownership of those outlets or any other view-related data that you no longer need.