views:

1170

answers:

5

Within Interface Builder, I have the following

UIViewController
-- View
---- TableView

In my UIViewController I have set

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}

I also have other view controllers that are in IB. What am I missing here? The only way I can get it to rotate is if I use the transform method.

A: 

I just tried this, and it works as expected. You will need to provide more detail, I think. In my experience, when a view "fails" to rotate, that's because some view controller somewhere is telling it not to. Check to make sure all your view controllers are returning the right values from shouldAutorotateToInterfaceOrientation:

Mark Bessey
A: 

How does multiple view controllers effect this ?

I have one view controller that does not rotate (purposely) [My Main Menu]. It has a button that when pressed takes you to the view With that I want rotation.

Could this be the reason why? Can I have one view controller doesnt want autorotate and another that can?

+1  A: 

Are you using the tableview in a tab-based app by any chance? In case you are, you can only get a view to support landscape mode if all the viewcontrollers of the tabbar controller support landscape mode.

Other than that, I don't see any reason why your view should not support landscape mode.

lostInTransit
A: 

Thanks for the replies.

No the TableView within a normal UIView. ALthought the original code had a TabBar (but no controller). The Tab Bar is no longer there and was deleted.

Yes this is very strange. I give up and used transform instead. I now have to put the UITableView in some akward position so it looks correct when it rotates in code..argghhhhh

I think it has to do with multiple Viewcontrollers ?

One note: I force my app to go in landscape in the info.plist.

A: 

So is the UIView that contains the table view also controlled by a UIViewController for which the autorotation is set to YES?

Amagrammer