Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

wlh99

macrumors 6502
Original poster
Feb 7, 2008
272
0
I am writing an app that runs in LandscapeRight. I want a spash screen to show briefly, then have the main view load.

I have the following:

Code:
- (void)applicationDidFinishLaunching:(UIApplication *)application {    
    
    // Override point for customization after app launch    

	[window addSubview:splashScreen.view];
	[window makeKeyAndVisible];

}

-(void)begin
{
	NSLog(@"App Delegate Begin");	
	[window resignKeyWindow];
	[splashScreen.view removeFromSuperview];
	[window addSubview:viewController.view];
	[window makeKeyAndVisible];
}


// Overriden in both view controllers

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
	
		NSLog(@"%d",interfaceOrientation);
 return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);


}

The problem is that the main view (viewController.view) is all screwed up. But if I get rid of the spash screen an add the view in applicationDidFinishLaunching it displays fine. I don't understand why there is a difference, as the orientation doesn't change. I also have UIInterfaceOrientationLandscapeRight set in Info.plist, but that didn't seem to matter.
 

Attachments

  • Picture 1.png
    Picture 1.png
    140.1 KB · Views: 42
  • Picture 2.png
    Picture 2.png
    159.8 KB · Views: 44
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.