#import "NotesAppDelegate.h"
#import "NotesTableViewController.h"
#import "NotesInsertViewController.h"

@implementation NotesAppDelegate

@synthesize window;


#pragma mark -
#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
    
    // Create the tabBarController
	tabBarController = [[UITabBarController alloc] init];
	
	// Create two view controllers
	UIViewController *notesTable = [[NotesTableViewController alloc] initWithStyle:UITableViewStylePlain];
	UIViewController *notesInsert = [[NotesInsertViewController alloc] init];
	
	// Make an array containing the two view controllers
	NSArray *viewControllers = [NSArray arrayWithObjects:notesInsert, notesTable, nil];
	
	[notesTable release];
	[notesInsert release];
	
	// Attach them to the tab bar controller
	[tabBarController setViewControllers:viewControllers];
	
	// Put the tabBarController's view on the window
	[window addSubview:[tabBarController view]];
	
    [self.window makeKeyAndVisible];
    
    return YES;
}

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


@end