0
泄漏仪表指向“cell.textLabel.text = str;”作为内存泄漏。我不知道为什么我自动释放细胞。iOS内存泄漏cellForRowAtIndexPath
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyIdentifier";
// Try to retrieve from the table view a now-unused cell with the given identifier.
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
// If no cell is available, create a new one using the given identifier.
if (cell == nil) {
// Use the default cell style.
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier] autorelease];
}
// Set up the cell.
NSString *str = [array objectAtIndex:indexPath.row];
cell.textLabel.text = str;
return cell;
}
后精铸人的价值是什么,如果你试图使用'的NSString *海峡= [NSString stringWithString:[array objectAtIndex:indexPath.row]];'? – Majster