So I’m stuck with a little problem that seems simple but is giving me fits.
Basically, I’ve got this kind of thing set up:
(1)–>(2)–>(3)
I drill down into a table, and once I’m at (3), I’d like to be able to swipe between two different views, while keeping the hierarchy intact. Like this:
(1)–>(2)–>(3a)/(3b) where 3a and 3b are able to be swiped back and forth. I also want to keep the back arrow for (2) on both views so that a user can go back.
The problem I’m having is that 3a and 3b will need to do separate calls for JSON data, so it’s more than just loading two images. I really need to load each entirely…
Any idea where to start? I’m experienced, but this just seems totally confusing. And I’m N2Deep to use storyboards now. Many thanks for any help!
The usual way I’d push a new view is like what I’ve done below. This obviously doesn’t work in this case…
if (!self.objTomorrowDetailViewController) { self.objTomorrowDetailViewController = [[TomorrowDetailViewController alloc] initWithNibName:@"TomorrowDetailViewController" bundle:nil]; }
[self.navigationController pushViewController:self.objTomorrowDetailViewController animated:YES];
Use
navigationController.viewControllersto get the current view stack, create a new one based on it (either via a mutable, or the new syntax@[oldVCs[0],oldVCs[1],newVC]). Set that to be the new stack with[navigationController setViewControllers:newVCArray animated:YES].