开发者

EXC_BAD_ACCESS in protocol?

开发者 https://www.devze.com 2023-04-09 08:05 出处:网络
I am getting EXC_BAD_ACCESS at the following line, what can be possbile reason, can any one explain 开发者_C百科 if([self.delegate respondsToSelector:@selector(dealInfo:imageDidDownload:indexPath:)])

I am getting EXC_BAD_ACCESS at the following line, what can be possbile reason, can any one explain

   开发者_C百科 if([self.delegate respondsToSelector:@selector(dealInfo:imageDidDownload:indexPath:)])//Here is EXC_BAD_ACCESS

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

I have done deal.delegate=self;, and deal is declared in delegate method of UITableView

      cellForRowAtIndexPath

something like below

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

HELP!


EXC_BAD_ACCESS usually means you're trying to access a released object. In this case, delegate is probably released before you call respondsToSelector: on it.

0

精彩评论

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

关注公众号