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

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?
 
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.
 
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.
 
Very good. I don't really know why but a lot of developers think they can avoid view controllers.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.