Instruments is reporting all the leaks of this VC in this method. What could be the reason? I think it’s the alloc, but don’t know why is leaking.
- (void)loadViewContent
{
switch (self.currentView)
{
case 0:
self.title = @"Title 1";
[self.navigationItem.backBarButtonItem release]; //para evitar un memory leak
self.navigationItem.backBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Blood" style:UIBarButtonItemStylePlain
target:nil action:nil] autorelease];
[tableContent addObject:@"0"];
[tableContent addObject:@"1 - 49"];
[tableContent addObject:@"50 - 75"];
[tableContent addObject:@"76 - 89"];
[tableContent addObject:@"More than 89"];
break;
case 1:
self.title = @"Title 2";
[self.navigationItem.backBarButtonItem release];
self.navigationItem.backBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"Resp. Rate" style:UIBarButtonItemStylePlain
target:nil action:nil] autorelease];
[tableContent addObject:@"0"];
[tableContent addObject:@"1 - 5"];
[tableContent addObject:@"6 - 9"];
[tableContent addObject:@"More than 29"];
[tableContent addObject:@"10 - 29"];
break;
default:
break;
}
}

Thanks in advance!
The following code definitely leaks (assuming a memory model of copy or retain on the property tableContent):
The setter of tableContent will release the old value and retain / copy / assign the new value. Consider a statement like:
This is perfectly valid because [NSMutableArray array] is an autoreleased object. Subsequent uses of self.tableContent only work after this because the setter of tableContent increments the retain count preventing tableContent from being released.
Your code (as weird as this seems) should be like the following:
OR – requires using an autoreleased object which some devs like to avoid where possible
OR – uses an unnecessary temp variable to clarify memory management