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];
}
}
'-[NSIndexPath setTableViewStyle:]: unrecognized selector sent to instance 0x7fb28b0
解决方法:
在定义cell时,加入
if([[cell.contentView subviews] count] >0)
{
for (UIView *temp in [cell.contentView subviews]) {
[temp removeFromSuperview];
}
}
相关文章推荐
- 出现“unrecognized selector sent to instance”问题原因之一及解决方法。
- 出现“unrecognized selector sent to instance”问题原因之一及解决方法。
- 出现“unrecognized selector sent to instance”问题原因之一及解决方法。
- 出现“unrecognized selector sent to instance”问题原因之一及解决方法。
- unrecognized selector sent to instance问题原因之一及解决方法。
- 出现“unrecognized selector sent to instance”问题原因之一及解决方法。
- unrecognized selector sent to instance 0x7fbb51c7c490问题解决方法之一
- “unrecognized selector sent to instance”问题原因之一及解决方法。
- 问题解决unrecognized selector sent to instance
- UNRECOGNIZED SELECTOR SENT TO INSTANCE 问题快速定位的方法
- UNRECOGNIZED SELECTOR SENT TO INSTANCE 问题快速定位的方法
- 问题解决unrecognized selector sent to instance
- [**ViewController respondsToSelector:]: message sent to deallocated instance崩溃问题解决方法
- Unrecognized Selector Sent to Instance问题之诱敌深入关门打狗解决办法
- UNRECOGNIZED SELECTOR SENT TO INSTANCE 问题快速定位的方法
- unrecognized selector sent to instance 0x1b97e0' 问题解决记录
- UNRECOGNIZED SELECTOR SENT TO INSTANCE 问题快速定位的方法
- UNRECOGNIZED SELECTOR SENT TO INSTANCE 问题快速定位的方法
- iOS -[__NSArrayI addObject:]: unrecognized selector sent to instance~解决方法
- UNRECOGNIZED SELECTOR SENT TO INSTANCE 问题快速定位的方法