Custom delegate : How to call back from modalViewController tapping on done?
Question
I want to use custom delegate in my search tab.
I have never used my own custom delegate in any application ( this is the just second one ).
The scenario is as below :
In the search utility ,If I am pressing select category , a modal view controller will be presented in that I am passing a category controller as a parameter .
Now I set its delegate to self .
In the modal view controller , after user selects one of the category and then presses done the done method in the search controller is executed as I have implemented CategoryControllerDelegate .
I have a little idea of all this . But not a full picture .
So tell me how to do all this in code , or If anyone have example ,Please provide the link . EDIT : The question is made a class with custom delegate then set the delegate to self then it should be called on done button tapped in madal view controller .
Solution
I'm not entirely sure I understand the question, but if you look at the Utility app template, the way the FlipsideViewController is presented is as a modal view controller.
Basically the modal view controller calls it's delegate with an "i'm done" method, and then the delegate calls [self dismissModalViewControllerAnimated:YES];
if you need to pass data back from the modal view, your "i'm done method" should accept whatever object you need.