Accessing another view controller's function
<p>I need to access another view controller's function from a modal view,
but the problem is, the view controller being called is not a parent controller of the modal view which calls it. So I cannot use self.parentViewController.
I'm currently using the following, but it crashes.</p>

<pre><code>in the modal view,
#include "mainViewController.h"

..........

        MainViewController* mainView;
        mainView = (MainViewController*) [[UIApplication sharedApplication] delegate];
        [mainView reset:(id)sender];
</code></pre>

<p>Any idea what's wrong?
Please help me.</p>
