objective c - Switching to a UITabBarController at a specific index -
I am trying to switch back to UITabBarController in a specific index. My method does not seem to work here. My code is:
BaseViewController.m
- (zero) switch tab visibility: (NSString *) viewName inx: (int ) Index {UIStoryboard * storyBoard = [UIStoryboard storyboardWithName: @ "man_iphone" bundle: zero]; UITabBarController * View = [storyBoard instantiateViewControllerWithIdentifier: viewName]; View.tabBarController.selectedIndex = Index; [Self-present ViewController: see animated: yes complete: zero]; }
ChildViewController.m (BaseViewController inherits)
- (IBAction) Backbuttonclosed: (ID) sender {[Self switch tab visibility: @ "Tab view" Inks : 1]; }
It goes back to the UITabBarController, but the index argument does not appear because it always goes to index 0.
- (zero) switch tab view: (NSString *) viewName Inx: (int Index) {UIStoryboard * StoryBoard = "post-text" itemprop = "text" [UIStoryboard storyboardWithName: @ "men_iphone" bundle: zero]; UITabBarController * View = [storyBoard instantiateViewControllerWithIdentifier: viewName]; View.tabBarController.selectedIndex = Index; [Self-present ViewController: see animated: yes complete: zero]; } - (zero) switch tab visibility: (NSString *) viewName Inx: (int Index) {UIStoryboard * storyBoard = [UIStoryboard storyboardWithName: @ "men_phone" bundle: zero]; UITabBarController * View = [storyBoard instantiateViewControllerWithIdentifier: viewName]; View.selectedIndex = Index; [Self-present ViewController: see animated: yes complete: zero]; }
Comments
Post a Comment