UIViews firing an action in another UIViewController
<p>My iPhone app is made of of a main tabController with 4 main tabs.  I have a situation where ViewController A loads ViewController B (using pushViewController).  I now need to get back to ViewController A and and trigger an action on A from B.  </p>

<p>Getting back to A is easy all I have to do is :-</p>

<pre><code>self.tabBarController.selectedIndex = 0;
[self.navigationController popViewControllerAnimated:YES];
</code></pre>

<p>this then causes the ViewController A to be visible.</p>

<p>But how do I then get ViewController B to fire an action on A?</p>

<p>I have tried to use:-</p>

<pre><code>ViewControllerA  *aVC = ((ViewControllerA *)((UIViewController *)[self.tabBarC.tabBarController.viewControllers objectAtIndex:0]));
[aVC setAnnoSelected];
</code></pre>

<p>Only when I do that I get:-</p>

<pre><code>-[UINavigationController setAnnoSelected]: unrecognized selector sent to instance 0x461d290
</code></pre>

<p>I have tried to use </p>

<pre><code>[ViewControllerA performSelector:@selector(setAnnoSelected) withObject: nil afterDelay: 0.0];
</code></pre>

<p>But so far no joy.</p>

<p>Any ideas would be greatly appreciated.</p>

<p>Thanks
Cheryl</p>

<p>P.S. This is a great site for help - thanks to anyone who has ever answered a question as you have helped me too.</p>
