title: How to call a ViewController.m method from the AppDelegate.m
body: <p>In my ViewController.m I have my void "Save Data":</p>
  
  <pre><code>#import "ViewController.h"
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  @synthesize myDatePicker, myTextField;
  
  -(void)saveData
  {
  NSArray *value = [[NSArray alloc] initWithObjects:[myTextField text],[myDatePicker date], nil];
  [value writeToFile:[self getFilePath] atomically:YES];
  
  }
  </code></pre>
  
  <p>And I want to use my void "Save Data" in my AppDelegate.m :</p>
  
  <pre><code>- (void)applicationDidEnterBackground:(UIApplication *)application
  {
  
  [self.ViewController saveData];
  
  }
  </code></pre>
  
  <p>But Xcode doesn't recognize the "ViewController" neither "saveData".</p>
  
  <p>I don't know if I have to #import something in my AppDelegate, please help.</p>