Reputation: 1443
Ok here is the structure of the app:
in delegate, i add rootViewController as subview to the window:
RootViewController *rootView = [[RootViewController alloc] init];
[window addSubview:rootView.view];
In rootViewController there is an inteface I crate programmatically (a brunch of buttons like the springboard), and is currently working only in portrait mode.
When I add:
- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation
{
NSLog(@"we are here");
return YES;
}
nothing happens, its called just when the app runs, and not when I change orientations.
So what I miss ? How I will make my View controller rotate based on orientation?
thanks for any help.
Upvotes: 0
Views: 1355
Reputation: 1443
Ok, i have found the solution
Looks like based on the apple docs I have to add the RootViewController as retainable property and then orientations work as it should.
Thanks for the help anyway.
Upvotes: 0
Reputation: 17054
You should configure your Info.plist correctly
Check if the UISupportedInterfaceOrientations~ipad (Supported interface orientations (iPad)) array is present, if not add this node and the orientations you want to be supported in your app.
Upvotes: 4