IOS6中 tableViewCell侧滑,处于编辑状态 点击返回上个页面 没有任何问题
但是在IOS7以后的系统中 这样操作会出现message sent to deallocated instance 0x12e23ac50错误
原因是下面这个方法的使用导致的
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
解决办法
1,
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
如果此方法没有用到,删掉就可以了
2,如果一定要用到此方法,在
- (void)viewWillDisappear:(BOOL)animated方法中添加
_tableView.editing = NO;这句代码就可以解决了
本文介绍了在iOS7及更高版本系统中,tableViewCell处于编辑状态下点击返回按钮时出现的“messagesenttodeallocatedinstance”错误。该错误由tableView的canEditRowAtIndexPath方法不当使用引发。文章提供了两种解决方案:一是删除未使用的canEditRowAtIndexPath方法;二是在viewWillDisappear方法中设置tableView的editing属性为NO。

6798

被折叠的 条评论
为什么被折叠?



