51 [pool release]; |
51 [pool release]; |
52 return retVal; |
52 return retVal; |
53 } |
53 } |
54 |
54 |
55 @implementation SDLUIKitDelegate |
55 @implementation SDLUIKitDelegate |
56 @synthesize uiwindow, window, viewController; |
56 @synthesize uiwindow, window; |
57 |
57 |
58 // convenience method |
58 // convenience method |
59 +(SDLUIKitDelegate *)sharedAppDelegate { |
59 +(SDLUIKitDelegate *)sharedAppDelegate { |
60 // the delegate is set in UIApplicationMain(), which is guaranteed to be called before this method |
60 // the delegate is set in UIApplicationMain(), which is guaranteed to be called before this method |
61 return (SDLUIKitDelegate *)[[UIApplication sharedApplication] delegate]; |
61 return (SDLUIKitDelegate *)[[UIApplication sharedApplication] delegate]; |
109 -(void) applicationDidFinishLaunching:(UIApplication *)application { |
110 -(void) applicationDidFinishLaunching:(UIApplication *)application { |
110 //[application setStatusBarHidden:YES animated:NO]; |
111 //[application setStatusBarHidden:YES animated:NO]; |
111 //[application setStatusBarHidden:YES withAnimation:NO]; |
112 //[application setStatusBarHidden:YES withAnimation:NO]; |
112 [application setStatusBarHidden:YES]; |
113 [application setStatusBarHidden:YES]; |
113 [application setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO]; |
114 [application setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO]; |
114 |
115 |
115 self.uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
116 self.uiwindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; |
116 self.uiwindow.backgroundColor = [UIColor blackColor]; |
117 self.uiwindow.backgroundColor = [UIColor blackColor]; |
117 |
118 |
118 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) |
119 if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) |
119 self.viewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPad" bundle:nil]; |
120 viewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPad" bundle:nil]; |
120 else |
121 else |
121 self.viewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPhone" bundle:nil]; |
122 viewController = [[MainMenuViewController alloc] initWithNibName:@"MainMenuViewController-iPhone" bundle:nil]; |
122 [uiwindow addSubview:viewController.view]; |
123 [uiwindow addSubview:viewController.view]; |
123 [viewController release]; |
|
124 |
124 |
125 // Set working directory to resource path |
125 // Set working directory to resource path |
126 [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]]; |
126 [[NSFileManager defaultManager] changeCurrentDirectoryPath: [[NSBundle mainBundle] resourcePath]]; |
127 |
127 |
128 [uiwindow makeKeyAndVisible]; |
128 [uiwindow makeKeyAndVisible]; |