Pop to root view controller without animation crash for the table view

后端 未结 6 1154
伪装坚强ぢ
伪装坚强ぢ 2021-02-05 19:27

I have 3 view controller in a tab bar controller. Clicking on any tab loads its root view controller in the navigation stack.

e.g. tab1, tab2, and tab3.
The 2nd vi

6条回答
  •  我寻月下人不归
    2021-02-05 20:05

    While Jesse's answer provided insight into the semantics around this problem, in my case the underlying cause was different. Just thought I'd mention it in case someone finds himself in the same situation.

    I was seeing the error message

    * -[UIAnimator removeAnimationsForTarget:]: message sent to deallocated instance ...

    where the object in question was a UITableViewCell. On inspection, there were no memory allocation issues in my code.

    The problem turned out to be that I was calling one of the popViewController:animated: family of methods from a non-UI thread. This thread had been created to run some network operations and database processing tasks. I simply moved the invocation of the pop method to the UI thread and found that I stopped getting the error.

提交回复
热议问题