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

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

    Had a similar problem and Im pretty sure it has something to do with the new SDK to be honest. The following code worked fine before. I have one navigationcontroller and a new one pushed on to that with 3 different views that gets put onto it (Think: changing password where you have 3 different steps: control, change, repeat.) If the user types the wrong password you will first be pushed of the "changing password controller" and then be pushed to the first page (logged out).

    This worked before:

    -(void)logout {
        [self.presentedViewController dismissModalViewControllerAnimated:TRUE];
    
        self.localNavigationController = nil;
    
        [self.navigationController popToRootViewControllerAnimated:TRUE];
     }
    

    The way you could solve this is by change ViewWillAppear to ViewDIDAppear. You might have some lagg but atleast it doesnt crash :)

提交回复
热议问题