I'm about to wrap up my first iPhone app and figured I'd run it through the Leaks Performance Tool. After fixing one obvious one, the only one I have left is one with a Nib acting as a table header view loaded through loadNibNamed (I was following the Recipes demo here).
- (void)viewDidLoad {
[super viewDidLoad];
if (self.tableHeaderView == nil) {
[[NSBundle mainBundle] loadNibNamed:@"TableHeaderView" owner:self options:nil];
self.tableView.tableHeaderView = self.tableHeaderView;
}
}
Then in dealloc:
- (void)dealloc {
[tableHeaderView release];
[super dealloc];
}
Instruments tells me that I'm leaking 256 bytes with 2 leaks coming from the line with loadNibNamed. tableHeaderView is the only top level object in the Nib (I've verified that in the debugger). Is there something I'm forgetting to release? Am I misinterpreting what Instruments is telling me? Is it wrong? Is it something that the OS will clean up later?