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

后端 未结 6 1055
伪装坚强ぢ
伪装坚强ぢ 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:08

    You can try this to avoid the problem:

    -(void)viewWillAppear:(BOOL)animated
    {
       if (animated)
       {
          [self.tableView reloadData];
       }
    }
    

    When navigating from a tab bar controller, the view will not be animated. So if the view is appearing just for an instant before popping to the root, it won't attempt to reload the table data.

提交回复
热议问题