views:

48

answers:

3

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.

+1  A: 

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.

alt text

F.Santoni
yep, forgot to say that I have allready setup info.plist. I have 4 items in that array, one for each orientation.
kitsos
Have you some other viewControllers or RootVC is the only one ?
F.Santoni
A: 

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.

kitsos