Connecting To a Label Within A UIView Of A Tab
<p>I am creating my first tab controller app. I have 2 tabs with 2 UIViews in them. I did this mostly from Interface Builder all I did in Xcode was add 2 files firstControllerView and SecController view. I can see the tab controller is working went I run the app (I simply changed the background color on the 2 UIViews in the tabs to see the effect).</p>

<p>Now I want to add a label to the secondView and set its text programmatically from code. This is whats breaking for me! I am doing something wrong. In my SecondViewController.h it looks like this:</p>

<pre><code>@interface SecondViewController : UIViewController {
    IBOutlet UILabel *title;
}

@property (nonatomic,retain) UILabel *title;

@end
</code></pre>

<p>and the .m looks like this...</p>

<pre><code>#import "SecondViewController.h"

@implementation SecondViewController

@synthesize title;

// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {   
    [title setText:@"Hello Nick"];

    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}

- (void)dealloc {
    [title release];
    [super dealloc];
}

@end
</code></pre>

<p>After this I went back to Interface Builder and dragged the outlet reference to the label. When I run the simulator it crashes.</p>

<p>What am I missing here? It must be something simple.</p>
