对象已发送-自动释放次数过多,是否为我的iPhone应用程序造成了泄漏? [英] Object sent - autorelease too many times, getting this leak for my iPhone app?

查看:70
本文介绍了对象已发送-自动释放次数过多,是否为我的iPhone应用程序造成了泄漏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发送的对象太多-自动释放太多,这对于我的iPhone应用程序来说是内存泄漏,并且不知道如何解决它 http://screencast.com/t/fPzMNewvq 上面是相同的屏幕截图.

I am getting too many Object sent - autorelease too many times, this memory leak for my iPhone app and dont know how to resolve it http://screencast.com/t/fPzMNewvq Above is screen shot for the same.

SAAdvertiseCell有许多要释放的对象,那么如何找到确切的问题在哪里呢? 谢谢

SAAdvertiseCell has lot of objects which are releasing, so how is it possible to find where the exact problem is? Thanks

推荐答案

首先,为什么不重用单元格?

At first why don't you reuse cells?

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

    Cell* cell = [tableView dequeueReusableCellWithIdentifier:cell_id];
    if(!cell)
    {
        cell = // create new cell;
    }

    // configure cell

    return cell;
}

还有一个问题:似乎initWithData:已经返回了一个自动释放的对象,然后您发送了另一个自动释放的对象.因此,请检查该方法以查找问题.

And for your problem: seems that initWithData: already returns an autoreleased object, then you send another autorelease. So check that method to find the problem.

这篇关于对象已发送-自动释放次数过多,是否为我的iPhone应用程序造成了泄漏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆