Skip to content

Instantly share code, notes, and snippets.

@quique123
Created December 3, 2009 16:51
Show Gist options
  • Save quique123/248326 to your computer and use it in GitHub Desktop.
Save quique123/248326 to your computer and use it in GitHub Desktop.
//
// P3ScratchAppDelegate.m
// P3Scratch
//
// Created by Marcio Valenzuela on 10/30/09.
// Copyright Personal 2009. All rights reserved.
//
#import "P3ScratchAppDelegate.h"
@implementation P3ScratchAppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(UIApplication *)application {
//ADD PARENT TABBAR VIEWCONTROLLER
tabBarController = [[UITabBarController alloc] init];
//CREATE NAVIGATIONCONTROLLER FOR FIRST TAB CHILD
navigationController = [[UINavigationController alloc] init];
//CREATE FIRST TAB CHILD
PersonListViewController *personController = [[PersonListViewController alloc] initWithStyle:UITableViewStylePlain];
[navigationController pushViewController:personController animated:NO];
personController.title = @"Personal TimeLine";
personController.tabBarItem.image = [UIImage imageNamed:@"presence-icon.png"];
//CREATE SECOND TAB CHILD
PublicTimelinesViewController *publicViewController = [[PublicTimelinesViewController alloc] init];
publicViewController.title = @"Public TimeLine";
publicViewController.tabBarItem.image = [UIImage imageNamed:@"all.png"];
//Heres the parent adding children
tabBarController.viewControllers = [NSArray arrayWithObjects:navigationController, publicViewController,nil];
splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
splashView.image = [UIImage imageNamed:@"Default.png"];
[window addSubview:splashView];
[window bringSubviewToFront:splashView];
//ADD TABBAR TO WINDOW
[window addSubview:tabBarController.view];
// Override point for customization after application launch
[window makeKeyAndVisible];
[splashView removeFromSuperview];
[splashView release];
[PublicTimelinesViewController release];
[personController release];
[navigationController release];
}
- (void)dealloc {
[window release];
[tabBarController release];
[super dealloc];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment