您的位置:首页 > 其它

unrecognized selector sent to instance 问题的解决方法

2012-08-15 21:01 513 查看
在一个tableView中加入两个自定义cell时,出现了如下错误,在网上找了一下出现这个问题的原因很多。我所遇到的是第二次加载第二个cell时,才会出现。

'-[NSIndexPath setTableViewStyle:]: unrecognized selector sent to instance 0x7fb28b0

解决方法:

在定义cell时,加入

if([[cell.contentView subviews] count] >0)
{
for (UIView *temp in [cell.contentView subviews]) {
[temp removeFromSuperview];
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐