iOS Auto-rotating intro-screen not working [ipad]

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
Ive got an intro-view that appears right after the splash-screen, and that is loaded from the didFinishLaunchingWithOptions in the AppDelegate.m-file.

Problem is it wont rotate when the device rotates. This despite the fact that the splash-screen rotates fine to the selected orientation, and that the info-file supports all 4 rotations.

Code:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
	[window addSubview:splitViewController.view];
	[window makeKeyAndVisible];

	// Create intro-screen, with some nick-nacks not included here
	CGSize screenSize = [UIScreen mainScreen].bounds.size;
	CGRect screenBounds = CGRectMake(0, 0, screenSize.width, screenSize.height);	
	introView = [[UIView alloc] initWithFrame:screenBounds];	
	[window addSubview:introView];

	return YES;	
}
Any idea as to what might be causing it?
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
There's a reason that apple invented view controllers. Make your view and view controller part of the view controller hierarchy and it should work.
 
Comment

Danneman101

macrumors 6502
Original poster
Aug 14, 2008
361
1
I see - only a viewcontroller can handle auto-rotation of views, whereas auto-rotating the default.png is a totally separate issue.

In my case, having a splitviewcontroller-app, the solution was simply to utilize that viewcontroller instead of making a new one. So, instead of adding the view to the window, I added it to the splitviewcontroller as such:

Code:
[splitViewController.view addSubview:introView];
Thanks for the input.
 
Comment

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
Very good. I don't really know why but a lot of developers think they can avoid view controllers.
 
Comment
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.