views:

17

answers:

0

Hello,

consider a tab bar controller whose tabs are implemented by navigation controllers. Given the action of the user on tab A, I first need to programmatically select tab B, pop to its navigation's root view controller, do some modifications therein and push another view controller onto the stack. However the naive approach

tabBarController.selectedViewController = navigationControllerB;
[navigationControllerB popToRootViewControllerAnimated:YES];
rootViewControllerB.someLabel.text = @"Foo";
[navigationControllerB pushViewController: ... animated:YES];

does not seem to work most of the times: The last two lines have no effect on the user interface except that the navigation bar is sometimes hidden or corrupted.

Do you have any suggestions? Maybe I need to wait for each operation to complete before I can start the next operation -- but how would I go about that? Thank you very much.