I’m new with iphone development
I created my storyboard with tabbar and tabbaritems with their viewcontroller
but now I would like to access viewcontroller instances from my uitabbarcontroller.m
anybody have any url with code example?
the codes I find are very simple use or tabbar, mostly just the storyboard which doesn’t help in anything…
thanks
—solution after help from Muller
on the uitabbarcontroller:(I placed a breakpoint and was able to retrieve the collection of viewcontrollers)
- (void)viewDidLoad
{
NSArray *arr = self.viewControllers;
}
You could use something like
This returns an array of all the views within your tabBarController, so if your first view is of class, let’s say TestView we could do something like
Note that this is off the top of my head, so it may be a little off. Make sure you check out the class reference materials that apple provides: UITabBarController Class Reference
EDIT: You could really just one-line it like this:
EDIT2: You can access the UITabBarController if it is declared in your AppDelegate by: