Let me try and clear is up for you.
On top of the normal memory management rules, the following rules apply:
1. If your IBOutlets are properties with the 'retain' keyword, then it is down to you to ensure they are released when the view is unloaded. That is because your subviews are being retained twice. Once, by its parent view and once by your controller. When the parent view is unloaded, it will relinquish it's ownership of the subviews but its down to you to make sure your controller does too, in viewDidUnload.
2. The advised way of doing this is to both release and nullify the pointer otherwise you may leave dangling pointers to deallocced objects. You can do this with one line but be aware of any side effects if you have overridden any of your property setter methods.
Code:
- (void)viewDidUnload
{
[super viewDidUnload]
self.somesubview = nil;
}
3. You should also release your instance variables directly in dealloc as usual. There is no need to check if they are nil, just call release. It is safe to call release on nil (that is why you set your properties to nil above instead of just releasing them).
Hope that helps.
A small aside, Im still baffled by people who resist Interface Builder and there is nothing worse than inheriting a codebase that doesn't use nibs. Writing all of your view initialisation, configuration and layout in code buys you little to nothing and results in a codebase that is harder to maintain. Embrace IB. Apple recommend you use it for good reason and Im happy to see it even more tightly integrated with Xcode in v4. There are times when manually writing view code makes sense but 80% of the time you should just let IB take care of the tedious boilerplate for you.
http://iphonedevelopment.blogspot.com/2009/10/dont-fear-interface-builder.html
This isn't really a dig at robbieduncan because he isn't the only person I've come across who tries to resist using Nibs but honestly, all you are doing is creating more work for yourself and costing your clients time and money, and obfuscating the interesting code with unnecessary boilerplate.