problem description
the login page of my app is a mode out of a VC app, log out, log in again, re-switch window.rootViewController
but found that the viewWillAppear method in the first child VC of tab has been walked twice
I found out the reason myself
the first pass is because I called dismissViewController
the second pass because I called appDelegate.window.rootViewController = tabVC;
but I don"t know how to solve this problem. I hope God will guide me
.related codes
[self dismissViewControllerAnimated:YES completion: ^ {
AppDelegate appDelegate = (AppDelegate ) [[UIApplication sharedApplication] delegate];
appDelegate.window.rootViewController = tabVC;
}];