Issue:
An UITabBarController delegate method calls viewDidLoad and negates/ignores the screen selection.
Background:
I am making a split-view controller for small iOS screens. So, far the screen looks something like this:
For the Detail View (RS), I'm using a UITabBarController, with the TabBar removed. You can find the code for this here.
The user selects the buttons on left, and a delegate sends the button's tag id to the UITabBarController delegate method.
The delegate method looks like this:
// delegate method in subclass of UITabBarController
-(void) screenSelected:(int)screenNum
{
NSLog(@"delegate arrived: %d", screenNum);
self.selectedIndex = screenNum;
// code goes to viewDidLoad
}
With breakpoints in place, I determined that the screen does not actually change.
If this screenSelected method is instead called from the UITabBarController viewDidLoad method (when the app first opens), the method works fine and the selectedIndex is changed as expected.
I'm trying to figure out why the delegate is triggering viewDidLoad. Does the delegate reset the view?
Thanks