All pastes #928499 Raw Edit

Untitled

public text v1 · immutable
·published 2008-03-05 02:38 UTC
rendered paste body
/*
        By: Jonathan McAllister
        Digital Trident 2008 (C)

*/
#import "App.h"
#import "App.h"

static Application *sharedInstance = nil;

@implementation Application

+ (Application *) sharedInstance {

	return ( sharedInstance ? sharedInstance : ( sharedInstance = [[self alloc] init] ) );

}

- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
	
	sharedInstance = self;
	currentView = nil;
	
	struct CGRect rect = [UIHardware fullScreenApplicationContentRect];
	rect.origin.x = rect.origin.y = 0.0f;

	UIWindow *window;
	window = [[UIWindow alloc] initWithContentRect: rect];
	mainView = [[UIView alloc] initWithFrame: rect];
 
	[window orderFront: self];
	[window makeKey: self];
	[window _setHidden: NO];
	[window setContentView: mainView];

	[self showView:[SplashView sharedInstance]];

}



- (id)showView:(UIView*)view{
	NSLog(@"removing subview: %@",currentView);
	[currentView removeFromSuperview];
	currentView = view;
	NSLog(@"adding subview: %@",view);
	[mainView addSubview:view];
	return self;
}



@end