0

I have 3 xib files, 3 buttons on all of the xib files and I am loading the view dynamically when a button is pressed.

For instance when button 1 is clicked then view 1 appears and similarly for button 2 and button 3. Is there any way to preserve these views like I have selected a tablecell and then I navigate to view 2 and then come back to button 1 and tablecell selected?

Please help me.

Maksim
  • 2,054
  • 3
  • 17
  • 33
ChArAnJiT
  • 238
  • 1
  • 7
  • 23

4 Answers4

0

I would suggest using Storyboard for having more then one View Controller. Then you can use segues to transition between the controllers.

sridvijay
  • 1,526
  • 18
  • 39
0

You are going to use UINavigationController to go from view to view. You'll have to read up on how to use it.

Dancreek
  • 9,524
  • 1
  • 31
  • 34
0

Within one viewcontroller, use addSubview: to add new views, use bringSubviewToFront: or sendSubviewToBack: to show different views, optionally removeFromSuperview. More options are in the UIView Class Reference.

ott--
  • 5,642
  • 4
  • 24
  • 27
0

Use the UINAvigtionController and also apply a method on table with in DidSelectRowAtIndexPath { [myTableView selectRowAtIndexPath:indexpath animated:NO scrollPosition:0]; }

it will help you when you come back.

Prabhat Kasera
  • 1,129
  • 11
  • 28