Sorry to reopen this thread after such a long time, but I've been searching for a simple answer to this question and this was one of the posts that came up in Google.
Essentially if you use interface builder to connect an IBOutlet instance variable to a control, you must always release said IBOutlet in your own -dealloc method.
e.g. in your .h file.
@interface MyView : UIViewController {
IBOutlet UILabel *myLabel;
}
@end
.m file..
-(void) dealloc {
[super dealloc];
// release all IBOutlets..
[myLabel release];
}
You always need to do this, even if you have defined a retain property for the IBOutlet. The reason for this is that loadFromNib will call setValue:withKey for each IBOutlet on your view controller class, which uses the property's setter method or retains the object by default if no setter method is available. There's no system to automatically release things created by the NIB so you need to manually release them yourself.
[Reference:
]Resource Programming Guide: Nib Files. Also see lecture 11 of CS193P at Stanford on iTunes U if it's still available - about 57 minutes in.
Regards,
Ben