Communication between two childViewControllers

What is the best way to communicate between two child view controllers ? I know the use of delegates to communicate between child and parent view controller but i am not able to get how to communicate between child view controllers of same parent view controller.

Answers


Well you could solve it with outlets what is the worse solution to my mind. Or you could inform your parentViewController about everything that happens and let him do the work (e.g. inform all objects that need specific information).

You would do it like this for example:

[childViewControllerInstance.parentViewController methodToCall];

In the class of the parent view controller you could then do everything you want and perform actions on whatever object is needed.

EDIT:

Please try

[childViewControllerInstance.parentViewController performSelector:@selector(methodToCall:) 
                 withObject:yourObjectToPass];

Need Your Help

Default button on enter and popup list

javascript jquery jsp

I'm trying to implement a form with multiple buttons on it. When I press enter I want to have my default button submitted. This code from http://greatwebguy.com/programming/dom/default-html-button-...