title: Call AppDelegate Method from Class
body: <p>Basically, I need to call a method in my AppDelegate from one of my view controller classes.</p>
  
  <p>Currently, I'm doing the following:</p>
  
  <p><code>myAppDelegate *appDelegate = (myAppDelegate *)[[UIApplication sharedApplication] delegate];</code></p>
  
  <p><code>[appDelegate doMethod];</code></p>
  
  <p>And including the myAppDelegate.h at the top of the .m file of the class:</p>
  
  <p><code>#import "myAppDelegate.h"</code></p>
  
  <p>When I run it, everything works...</p>
  
  <p>But I get the following warning:</p>
  
  <p><code>warning 'myAppDelegate' may not respond to '-doMethod'</code></p>
  
  <p>Is there another way that I should reference the app delegate?</p>
  
  <p>Thanks for any help in advance.</p>
  
  <p><strong><em>EDIT: FIXED:</em></strong></p>
  
  <p>All I had to do was declare the method in the .h file of the AppDelegate:</p>
  
  <p><code>-(void)doMethod;</code></p>