title: How to work with inheritance in iOS sdk
body: <p>I just started to learn iOS programming and I have a problem with inheritance. There are 2 files.</p>
  
  <p>First file</p>
  
  <p>Header</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  @interface ViewController : UIViewController {
      UILabel *myLabel;
  }
  @property (nonatomic, retain) IBOutlet UILabel *myLabel;
  @end
  </code></pre>
  
  <p>Implementation:</p>
  
  <pre><code>#import "ViewController.h"
  #import "NewClass.h"
  @implementation ViewController
  @synthesize myLabel;
  #pragma mark - View lifecycle
  - (void)viewDidLoad {
      [super viewDidLoad];
      myLabel.text = @"ViewController text!";    
      NewClass *myClass = [[[NewClass alloc] init] autorelease];
      [myClass setLabelText];
  }
  @end
  </code></pre>
  
  <p>Second file</p>
  
  <p>Header:</p>
  
  <pre><code>#import "ViewController.h"
  @interface NewClass : ViewController 
  -(void) setLabelText ;
  @end
  </code></pre>
  
  <p>Implementation:</p>
  
  <pre><code>#import "NewClass.h"
  @implementation NewClass
  - (void) setLabelText {
      myLabel.text = @"NewClass text!";
  }
  -(id)init { 
      self = [super init];                                       
      if (self != nil) {                                         
      }
      return self;                           
  }
  @end
  </code></pre>
  
  <p>And i set <code>myLabel</code> outlet in IB.</p>
  
  <p>Why when i call <code>[myClass setLabelText];</code> nothing happens? There also remained "ViewController text!" on label view.
  Where is my problem? How can i change <code>ViewController::myLabel.text</code> in <code>NewClass</code></p>