Update
Solved the issue and there was an cycle retain.
Original Question
Profile showed zero memory leak, however the app used more and more memory as time went.
Let’s just take one of the things in the app, and have a detailed look. There is a table view – let’s call it the main table, when click on any of its cell, it leads you to a second table view and the second one has 10 to 20 images on it.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
FlyerListTable *detail = [[FlyerListTable alloc] initWithNibName:@"FlyerListTable" bundle:nil];
detail.department = [categories objectAtIndex: indexPath.row];
detail.promotions = [items valueForKey:detail.department];
[self.navigationController pushViewController:detail animated:NO];
[detail release];
}
FlyerListTable is the class for the second table, and it has dealloc defined, however I traced it and this dealloc method was never called.
I would suggest you to make it lazy loaded:
Do not forget to release it in dealloc.
Then use it when the row is selected
If dealloc is not called in your example it means some other object has retained it. Try to find out what object may retain it before you make any changes. You can override retain method for this purpose:
Set a break point to see the call stack. You should not use ARC of course.
Good luck!