title: Problem setting Value for UILabel (iPhone SDK)
body: <p>I'm reasonably new at the iPhone SDK, so please forgive me if this answer's ridiculously obvious.</p>
  
  <p>I have a ViewController connected to a .xib file (they are called FirstViewController)</p>
  
  <p>I also have a custom class called MyCustomClass. In this class, I have a method like this:</p>
  
  <pre><code>- (void)setTheText {
      [myLabel setText:@"foo"];
  }
  </code></pre>
  
  <p>I want to call this method to set the text in a label in FirstViewController.xib</p>
  
  <p>So far, I have done this: </p>
  
  <p>Dragged in an "Object" into Interface Builder, and set the class to: MyCustomClass
  Connected up the IBOutlet 'myLabel' from MyCustomClass to a UILabel in the view.</p>
  
  <p>However, when I run the program, and press the button to set the label (which is in FirstViewController.m), something like:</p>
  
  <pre><code>- (IBAction)doSomething:(id)sender {
     MyCustomClass *customClass = [MyCustomClass alloc] init];
     [customClass setTheText];
  }
  </code></pre>
  
  <p>This doesn't set though. <code>NSLog(@"%@",[myLabel text]);</code> returns (null)</p>
  
  <p>Xcode shows no errors or warnings, what could be wrong?</p>
  
  <p>Thanks,</p>
  
  <p>Michael</p>
  
  <p>Additional Info:</p>
  
  <p>Interface to MyCustomClass.h:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface MyCustomClass : NSObject {
      UILabel *myLabel;
  }
  
  @property (nonatomic, retain) IBOutlet UILabel *myLabel;
  
  - (void)setTheText;
  
  @end
  </code></pre>