Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Well, wenn the view controllers in a tab bar have (or better are) navigation controllers, then the <code>viewControllers</code> array of the tab bar controller contains navigation controllers instead. Actually, you (or your storyboard) put them in! It may well be a mix of view controllers and navigation controllers, depending of what was actually set upon creation or reconfiguration (if any) of the tab bar. </p> <p>So I'd sugest to receive the object from <code>viewContollers</code> at the given index into something of type ID. Then check whether it is a navigation controller (use <code>isKindOfClass:[iPhone_ASRAViewController class]</code>) and if so then use it directly. If not then check whether it is of class UINavigationConroller (or the other way around - what ever is more convenient for you) and if so fetch its topViewController property and go from there. </p> <p>Edit: Added in response to comments: </p> <pre><code>id someController = [self.tabBarController.viewControllers objectAtIndex:3]; if (someController isKindOfClass:[UINavigationController class]) { someController = [someController topViewController]; //re-using someController } // someController should be a UIViewController from here onwards. But you may double check if you want. if (someController isKindOfClass:[iPhone_ASRAViewController class]) { iPhone_ASRAViewController *myIPhone_ASRAViewController (iPhone_ASRAViewController*) someController; // you may now savely access those properties that are unique to your custom view controller class } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload