title: how to update a UILabel's Text from AppDelegate.m file in Xcode?
body: <p>I'm new in Objective-C Programming. I want to get the text from a UILabel and at least NSLog that when the application enters the background. but all i got was a null value.(I don't know why!). I'm using story boards to create the view and UILabel and i have used CTRL+Drag to hook the label to my code and synthesized that in the implementation file. but I just get a null value in AppDelegate.m codes.</p>
  
  <p>These are my codes:</p>
  
  <p>ViewController.h:</p>
  
  <pre><code>@property (strong, nonatomic) IBOutlet UILabel *Mylabel;
  </code></pre>
  
  <p>ViewController.m:</p>
  
  <pre><code>@synthesize Mylabel;
  </code></pre>
  
  <p>AppDelegate.m:</p>
  
  <pre><code>#import "ViewController.h"
  
  - (void)applicationDidEnterBackground:(UIApplication *)application
  {
      ViewController * viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
      NSLog(@"%@",[[viewController Mylabel] text]);
  }
  </code></pre>