Hello, I'm new to programming on the iPhone and I've run into a problem.
I've implemented a navigation bar that pushes and pops views. However here is my issue:
current stack of views: [view 1, view 2, view 3]
target stack of views: [view 1, view 2, view 4]
In other words, I understand the basics of how to push/pop views with the navigation bar, but is there a way to basically switch the top view?
This is what I've tried, but it does not work. I think what these two lines of code do is get rid of the top view, then add a new view ON TOP of the view I just got rid of. In other words, these two lines result in the stack being [view 1, view 2] and do not work as I intended.
I've implemented a navigation bar that pushes and pops views. However here is my issue:
current stack of views: [view 1, view 2, view 3]
target stack of views: [view 1, view 2, view 4]
In other words, I understand the basics of how to push/pop views with the navigation bar, but is there a way to basically switch the top view?
This is what I've tried, but it does not work. I think what these two lines of code do is get rid of the top view, then add a new view ON TOP of the view I just got rid of. In other words, these two lines result in the stack being [view 1, view 2] and do not work as I intended.
Code:
[self.navigationController popViewControllerAnimated:NO];
[self.navigationController pushViewController:newView animated:NO];