Currently, I am trying to trigger the 'didSelectViewController' method programmatically via the following code:
self.tabController.selectedViewController
= [self.tabController.viewControllers objectAtIndex:NEWSTAB_INDEX];
However, the 'didSelectViewController' method wasn't called. How can I trigger the method without having to manually select the tab bar?
self.tabController.selectedIndex = NEWSTAB_INDEX; // to actually switch to the controller (your code would work as well) - not sure if this does or not send the didSelectViewController: message to the delegate
[self.tabController.delegate tabBarController:self.tabController didSelectViewController:[self.tabController.viewControllers objectAtIndex:NEWSTAB_INDEX]]; // send didSelectViewController to the tabBarController delegate
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With