UITableView: deleting sections with animation

后端 未结 7 1193
春和景丽
春和景丽 2020-12-02 05:39

Update

I have posted my solution to this problem as an answer below. It takes a different approach from my first revision.


Ori

7条回答
  •  温柔的废话
    2020-12-02 06:41

    I saw this same exact error as the result of prematurely releasing the background view of my custom tableview cell.

    With NSZombieEnabled I got a an exception being thrown way down below an internal call to a function to prepare the cell for reuse. Without NSZombieEnabled, I was getting the Internal consistency error.

    Incidentally when I fixed the retain/release issue on the background view of the cell, I was able to delete the last row of the section without having to delete the section explicitly.

    Moral of the story: This error just means something bad is happening when you try to delete, and one of the things that happens when you delete is the cell gets prepared for reuse, so if you are doing anything custom with your tableview cells, look for a possible error there.

提交回复
热议问题