tableView:canEditRowAtIndexPath: crash when popping viewController

前端 未结 4 1219
暗喜
暗喜 2021-01-30 13:29

I have a viewController with a UITableView, the rows of which I allow to edit (delete) with a swipe - much like in the Mail app. I do it with, among other, this met

4条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-30 13:55

    I had the same problem, but I was using ARC and I didn't want to be mucking about in the dealloc method. Doing it in viewWillDisappear was sufficient to stop the crash.

    - (void)viewWillDisappear:(BOOL)animated {
        [super viewWillDisappear:animated];
        [table setEditing:NO];
    }
    

提交回复
热议问题