协议中的EXC_BAD_ACCESS?

时间:2011-09-30 13:56:35

标签: iphone delegates protocols

我在下一行获得了EXC_BAD_ACCESS,可能是什么原因,任何人都可以解释

    if([self.delegate respondsToSelector:@selector(dealInfo:imageDidDownload:indexPath:)])//Here is EXC_BAD_ACCESS

    [self.delegate dealInfo:self imageDidDownload:thumbImage indexPath:self.indexPath];

我已经完成了deal.delegate = self;,并且在UITableView的委托方法中声明了交易

      cellForRowAtIndexPath

如下所示

    DealInfo *deal = [nearByDeals objectAtIndex:(section - 1)];
    deal.delegate = self;
    deal.indexPath = indexPath;

HELP!

1 个答案:

答案 0 :(得分:4)

EXC_BAD_ACCESS通常意味着您正在尝试访问已发布的对象。在这种情况下,代理可能会在您调用respondsToSelector:之前发布。