开发者

why is this a mem leak?

开发者 https://www.devze.com 2023-02-15 10:14 出处:网络
got this warning of a mem leak in the following... any ideas? - (UITableViewCell *)tableView:(UITableView *)tableView ce开发者_如何学JAVAllForRowAtIndexPath:(NSIndexPath *)indexPath {

got this warning of a mem leak in the following...

any ideas?

- (UITableViewCell *)tableView:(UITableView *)tableView ce开发者_如何学JAVAllForRowAtIndexPath:(NSIndexPath *)indexPath {
    NSUInteger row = [indexPath row];

    UITableViewCell *cell = [self newOrReusableCell];


    cell.textLabel.text = [_evaluationArray objectAtIndex:row];
    cell.selectionStyle = UITableViewCellSelectionStyleNone;

    return cell;

}

thanks

EDIT: here s the warning: ... Object allocated on line 128 and stored into 'cell' is returned from a method whose name ('tableView:cellForRowAtIndexPath:') does not contain 'copy' or otherwise starts with 'new' or 'alloc'. This violates the naming convention rules given in the Memory Management Guide for Cocoa (object leaked)


ah! forget it! found the answer.. is the way i named my cell...

0

精彩评论

暂无评论...
验证码 换一张
取 消