Surprisingly, this was a difficult problem to Google because the questions and answers never aligned to match my specific needs. In an unusual burst of insight, combined with some clues from Apple documentation and user posts, I came up with the following technique.
First, in the AppDelegate @interface (the main class), there is the line:
UITabBarController *rootController;
Next, in one of my subview controller interfaces, I have:
ColorMatcherAppDelegate *app;
which provides a pointer from a minor class to the main class. Next, I add the following to the @implementation of that same class:
app = [[UIApplication sharedApplication] delegate];
app.rootController.selectedIndex = 0;
When all is said and done, it only involves a few lines of code, but they sure were hard to find!
No comments:
Post a Comment