I'am working on an iOS project with xcode 5. I needed to show an option table in a pop-up, hence I used a container view and called it as a pop-up through segue. Now the problem is I want to close (not merely disappear) the container view as soon as I select a row inside it. Please guide me how to achieve it.Thanks in advance.
I finally found a solution to this , its not the feasible solution but saved me from bringing major changes in my project. What I did is -
I used unwind segue to pass back the value from child pop-up container to the main controller.For this I introduced two methods first one was: prepareForSegue method in container view controller-
another one was unwindSegue method in the ParentViewController -
but don't forget to declare the unwind segue in your ParentViewController.h file.
Now what I did is connected my prototype cell to the unwind segue in the storyboard and gave the unwindsegue an identifier name(present in Utility Area)
But the problem was that the unwind segue was called before didSelectRowAtIndexPath was called as a result although the pop up was able to close it self but was unable to send the desired value to the ParentViewController. For this I this I just called the prepareForSegue again in the method didSelectRowAtIndexPath, with syntax such as -
As I said its not a feasible solution but this finally solved my problem, but it would have been simpler if I would have used UIPopOverController.