0

I have a navigation controller:

enter image description here

when clicking in the cell button, it opens a new view with its own xib file:

    ParkingData *aController = [[ParkingData alloc]initWithNibName:@"ParkingData" bundle:nil];
    [[self navigationController] pushViewController:aController animated:YES];

It is perfectly linked in code, but, it is not into the viewControllers Array:

NSArray *viewArrays = [self.navigationController viewControllers];

NSLog(@"Views %@",viewArrays);


Views (
"<Favorite: 0x7c5f250>"
 )

How about ParkingData? How can I add it?

Thanks!

1 Answer 1

1

Your ParkingData *aController is your present view controller(i.e. view which you are seeing at the moment).... only the previous viewcontrollers, from which you pushed the view, are added to the self.navigationController.viewControllers array... Suppose if you push to another view controller form aController then your aController will be added to the self.navigationController.viewControllers array

Sign up to request clarification or add additional context in comments.

7 Comments

so, what I really want to do, is use the viewArray for: popToViewController:[viewArrays objectAtIndex:1], so, is this impossible on the first execution?
at this moment there is only one view in your array so you can pop to view onlt at index 0
so, how can I opened the second view under a condition? when the tab for this navigationController is pressed, if a condicion is true, I open the second view instead the first one.
sorry i dint get you? can you explain it using arrow -> to describe the flow
i am afraid you have to do it programatically. create a navigationcontroller programatically and check the condition and assign navigationcontroller.rootViewController=view_which_you_want_to_show_first
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.