title: iOS Updating ViewController UILabel from another Class
body: <p>I'm new to development and been banging my head against a wall trying to figure this out, I'm sure, that I'm missing something silly but after trying various different solutions, I'm still unable to get the result I'm looking for.</p>
  
  <p>I would like to be able to update a UILabel in a ViewController from another class, here is a little demo program that I cannot get to work, I have the ViewController which has two UILabels, one is updated from with the <code>viewDidDoad</code> and the other one I would like to update from the other class called NewClass which is called from <code>ViewController</code>, I can the see the class is being called correctly as the console is logging the <code>NSLog</code> entry but I cannot get the syntax for updating the <code>UILabel</code>.</p>
  
  <p>Thanks in advance.</p>
  
  <p><strong>ViewController.h</strong></p>
  
  <pre><code> #import &lt;UIKit/UIKit.h&gt;
  
   @interface ViewController : UIViewController {
  
     UILabel *_labelupdate01;
     UILabel *_labelupdate02;     
   }
  
   @property (nonatomic, retain) IBOutlet UILabel *labelupdate01;
   @property (nonatomic, retain) IBOutlet UILabel *labelupdate02;
  
   @end
  </code></pre>
  
  <p><strong>ViewController.m</strong></p>
  
  <pre><code>#import "ViewController.h"
  #import "NewClass.h"
  
  @interface ViewController ()
  
  @end
  
  @implementation ViewController
  
  @synthesize labelupdate01;
  @synthesize labelupdate02;
  
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      labelupdate01.text = @"Update from ViewController";
  
      [NewClass updatedisplay];
  }
  @end
  </code></pre>
  
  <p><strong>NewClass.h</strong></p>
  
  <pre><code>#import &lt;Foundation/Foundation.h&gt;
  
  @class ViewController;
  
  @interface NewClass : NSObject
  
  @property (nonatomic, assign) ViewController *ViewController;
  
  + (void)updatedisplay;
  
  @end
  </code></pre>
  
  <p><strong>NewClass.m</strong></p>
  
  <pre><code> #import "NewClass.h"
   #import "ViewController.h"
  
   @implementation NewClass
  
   @synthesize ViewController = _ViewController;
  
   + (void)updatedisplay
   {
       NSLog(@"NewClass - updatedisplay");
       ViewController *labelupdate02;
       labelupdate02.labelupdate02.text = @"Update from NewClass";
   }
  
   @end
  </code></pre>