2012-06-12 43 views
0

我的代碼是的UITableViewCell重載導致內存泄漏

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{ 

    NSString *CellIdentifier1 = [NSString stringWithFormat:@"SimpleCell"]; 

    UITableViewCell *cell1 = [tableView dequeueReusableCellWithIdentifier:nil]; 

    if (cell1 == nil) { 
     cell1 = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier1] autorelease]; 

    } 
    return cell1; 
} 

這總是引起libsystem_c.dylib mallic存儲器泄漏48個字節。 而且每次調用reloadData時都會累積內存泄漏。

歡迎參觀任何commen

回答