//
//  ViewBasedAppDelegate.m
//  ViewBased
//
//  Created by Brandon Trebitowski on 7/29/08.
//  Copyright __MyCompanyName__ 2008. All rights reserved.
//

#import "ViewBasedViewController.h"

@implementation ViewBasedViewController

@synthesize txtName,lblHello;

-(IBAction) updateText:(id) sender {
	NSString *text;
	if([txtName.text length] == 0)
	{
		text = @"Please enter your name";
	}
	else
	{
		text = [[NSString alloc] initWithFormat:@"Hello %@!",txtName.text];
	}
	
	lblHello.text = text;
	
	[text release];
}

/*
 Implement loadView if you want to create a view hierarchy programmatically
- (void)loadView {
}
 */

/*
 Implement viewDidLoad if you need to do additional setup after loading the view.
- (void)viewDidLoad {
	[super viewDidLoad];
}
 */


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
	// Return YES for supported orientations
	return (interfaceOrientation == UIInterfaceOrientationPortrait);
}


- (void)didReceiveMemoryWarning {
	[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
	// Release anything that's not essential, such as cached data
}


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

@end
