您的位置:首页 > 产品设计 > UI/UE

tableviewcell 侧滑删除 点击返回按钮 程序崩溃 [ tableView:canEditRowAtIndexPath:]:message sent to deallocated insta

2015-05-12 22:48 651 查看
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;这句代码就可以解决了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
相关文章推荐