Iphone UITableView中的内存泄漏

Iphone UITableView中的内存泄漏,iphone,memory,memory-leaks,Iphone,Memory,Memory Leaks,我正在使用自定义单元格填充我的一个表。但每当我上下滚动时,我都可以看到有一些泄漏发生,这些泄漏指向UIKit Lib。不知道为什么?为了便于参考,我附上了泄漏仪器泄漏的屏幕截图 感谢您的帮助 TableView cellForRowIndex: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *cellIde

我正在使用自定义单元格填充我的一个表。但每当我上下滚动时,我都可以看到有一些泄漏发生,这些泄漏指向UIKit Lib。不知道为什么?为了便于参考,我附上了泄漏仪器泄漏的屏幕截图

感谢您的帮助

TableView cellForRowIndex:

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

    NSString *cellIdentifier = [NSString stringWithFormat:@"EditingCell_%d_%d",indexPath.section,indexPath.row];
    EditingTableViewCell *cell = (EditingTableViewCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];

    if (!cell) {
        [self.appCellNib instantiateWithOwner:self options:nil];        
        cell = editingTableViewCell;        
        self.editingTableViewCell = nil;
    }
自定义单元格:


我不确定是否有足够的信息给出精确的解决方案。然而,我的猜测是,这些特性并没有很好地定义为用于充气的XIB。例如,您可能已将特性标签定义为:

这是错误的,会导致泄漏。定义出口的正确方法是:

// Interface declaration
UILabel *label;

// property 
@property (nonatomic, retain) IBOutlet UILabel *label;
这使得当xib膨胀时,变量的设置通过综合设置器,因此内存管理工作如您所期望的那样


希望有帮助!干杯

最有趣的部分必须在tableView:CellForRowatineXpath:method@Vince:我已经反复检查了好几次,但一切都很好。请输入tablecell创建代码here@manoj-所以,我很抱歉,不知道为什么会出现泄漏请在此处提供tableView:cellForRowAtIndexPath代码的更多详细信息。所以,我可以帮你更多。这不是问题,我总是喜欢声明第二个属性。
// Interface declaration
IBOutlet UILabel *label;

// property 

@property (nonatomic, retain) UILabel *label;
// Interface declaration
UILabel *label;

// property 
@property (nonatomic, retain) IBOutlet UILabel *label;