title: IBOutlet instances are (null) after loading from NIB
body: <p>I am working on an iPhone app and am getting (null) references to IBOutlet fields in my controller. I have a UIViewController subclass that is set as the File's Owner in my XIB. I have a set of UI elements that are wired into the controller. After loading from NIB and attempting to set properties on those UI elements, I find that they are (null). To clarify, some code:</p>
  
  <p>ExpandSearchPageController.h:</p>
  
  <pre><code>@interface ExpandSearchPageController : UIViewController
  {
    IBOutlet UITextView * completeMessageView;
  }
  
  -(void)checkTextField;
  
  @property (nonatomic, retain) IBOutlet UITextView * completeMessageView;
  </code></pre>
  
  <p>ExpandSearchPageController.m:</p>
  
  <pre><code>@implementation ExpandSearchPageController
  
  @synthesize completeMessageView;
  
  -(void)checkTextField
  {
    NSLog(@"text field: %@",completeMessageView);
  }
  </code></pre>
  
  <p>ExpandSearchPageController is set as the File's Owner for ExpandSearchPage.xib. ExpandSearchPage.xib's UITextView is wired to the completeMessageView.</p>
  
  <p>When I call </p>
  
  <pre><code>ExpandSearchPageController * searchExpanderPage = [[ExpandSearchPageController alloc] initWithNibName:@"ExpandSearchPage" bundle:[NSBundle mainBundle]];
  
  [searchExpanderPage checkTextField];
  </code></pre>
  
  <p>the result is</p>
  
  <pre><code>"text field: (null)"
  </code></pre>