I am using a SWreveal view controller whichs displays a list in a table view. I call this from View Controller A when user uses a gesture. When i select a row in the table view. View controller A is created again and displayed instead of showing the previous View controller A.. View controller A's View did load method is being called rather than calling View did appear
1 Answers
The problem is that you've configured your storyboard incorrectly. You're using a segue to go from the table view to the SWReveal view controller. A segue creates a new view controller, so you're seeing a new view controller. Thus you end up with three view controllers:
The original SWReveal view controller
The table view controller on top of that.
Another SWReveal view controller on top of that!
Instead of using a segue, just implement the didSelect...
delegate method of the table view controller to call dismissViewController
. Now the table view is removed in good order and you're back to the previous view controller.
Alternatively, set things up so that you can use an Unwind segue, which calls dismissViewController
for you. That's different from a normal segue.

- 515,959
- 87
- 875
- 1,141
-
if i do that can i pass the values from table view to my view controller ?? @matt – iOSDeveloper Sep 17 '14 at 17:04
-
1Yes, but you have to arrange to do that. – matt Sep 17 '14 at 22:12
-
arrange in the sense ? – iOSDeveloper Sep 18 '14 at 06:51
-
1Typically using delegation, as I explain here: http://www.apeth.com/iOSBook/ch19.html#_presented_view_controller – matt Sep 18 '14 at 12:56