The current structure of an ipad app im working on is like so – In a navigation based application’s view controller I have a tableview on the left side of the view and an IBOutlet connected uiview say View A on the right side (screen is divided in these 2 parts, much like a splitview controller). Clicking any row of the left table adds as subview, a uitableviewcontroller view say View A1 inside View A. Clicking any row in A1 brings up a modalview, say View B. View B now has buttons to bring up another view uitableviewcontroller say View A2. Now the way to bring up View A2 like as per the need, i need to first dismiss the modal View B and show the View A2 added as a subview on top of View A1 but with a back button. Hitting this back now should show the previously dismissed modal uiviewcontroller B, which on dismissing reveals View A1. Now I’ve managed to get everything working up to the point of showing modal View B, but im out of ideas how to proceed with the rest of the flow. Basic steps i need to put together would be,
- Dismiss B
- Show A2 over A1
- Clicked ‘back’ in A2
- Remove A2 & show B
- Dismissed B, show A1.
Any suggestions/ ideas/ code to do this?
I figured it quite a while ago but realised i never updated the answer here. So for anyone else who may have a similar implementation, the way i did it was to save a reference to the modal viewcontroller B in the viewcontroller A1, using it to show & dismiss B. Next was fairly simply to do some delegation to tell A1 when to display A2 and on dismissing A2, to tell A1 to show up the modal viewcontroller B. Took a while to do this but it worked like I wanted. HTH.