For each time UITableview is scrolled, there is a memory leak of 48 bytes.
Responsible library : libsystem_c.dylib
Responsible frame : strdup.
This is observed only on iOS 5.1 and not on earlier versions.
Did anyone else faced the same? Is this a bug in iOS 5.1?
Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath(NSIndexPath *)indexPath
{
NSString *cellIdentifier = [[NSString alloc] initWithString:@"fontSelectionCell"];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
[cellIdentifier release];
if (cell == nil)
{
cell = [[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier] autorelease];
}
cell.textLabel.text = [fontNameList objectAtIndex:[indexPath row]];
cell.selectionStyle =UITableViewCellSelectionStyleGray;
cell.textLabel.font = [UIFont systemFontOfSize:17.0];
if ([fontName isEqualToString:cell.textLabel.text])
{
cell.accessoryType = UITableViewCellAccessoryCheckmark;
cell.textLabel.textColor = [UIColor blueColor];
}
else
{
cell.accessoryType = UITableViewCellAccessoryNone;
cell.textLabel.textColor = [UIColor blackColor];
}
return cell;
}
I think you are having this issue that was already report on iOS 5.1. I am having that myself too. At the moment I wasn’t able to find the link in apple’s forums concerning this issue.