Hello guys,
I just wanted to know if anyone here can help me finding out how to get rid of a leak that has been bothering me for a while, but I have no clue on how to solve it. It's an iPhone app and I'm testing on a 3G iPhone, not the simulator. Here's the code:
Code:
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"BaseCell";
BaseCell *cell = (BaseCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:@"IndividualCell" owner:self options:nil]; //This is the line causing the leak as shown by the leaks instrument...
cell = tmpCell;
self.tmpCell = nil;
}
// Configure the cell.
NSArray *arr = [self.iconList objectForKey:@"inicio"];
cell.icon = [UIImage imageNamed:[arr objectAtIndex:indexPath.row]];
cell.numLines = 2;
cell.name = NSLocalizedString(([NSString stringWithFormat:@"RootViewController_%@", [self.menu objectAtIndex:indexPath.row]]),@"");
cell.fontSize = 21;
cell.textColor = [UIColor whiteColor];
cell.accessoryImage = [UIImage imageNamed:[self.iconList objectForKey:@"arrow"]];
cell.backgroundImage = [UIImage imageNamed:[self.iconList objectForKey:@"backgroundCell"]];
cell.selectedBackgroundImage = [UIImage imageNamed:[self.iconList objectForKey:@"selectedBackgroundCell"]];
return [cell autorelease];
}
Thank you all for your help! Any kind of clue will be really valuable for me!