UITabBarController -shouldAutorotateToInterfaceOrientation: warning

I am getting the following warning from lldb:

The view controller returned NO from -shouldAutorotateToInterfaceOrientation: for all interface orientations. It should support at least one orientation.

This is a standard UITabBarController, not a subclass and has no categories. Why am I getting this warning?

Answers


The default implementation of shouldAutorotateToInterfaceOrientation: for UITabBarController returns the orientations that is allowed for all the tabs.

So, you are either having one view controller (for a tab) that returns NO for all orientations or you are having conflicting orientations (one view which only supports landscape and another that only supports portrait).


It should support at least one orientation, doing a check to see if the orientation is portrait will return yes. return toInterFaceOrientation == UIInterfaceOrientationPortrait should help a lot.


Need Your Help

How do I automate Twitter Cards?

html twitter

I am looking to implement Twitter Cards on a site that runs on Wordpress (documentation on Twitter Cards here: https://dev.twitter.com/docs/cards)

Ambiguous scenario for iPhone memory management

ios memory-management properties dealloc

I have some difficulties to understand this scenario.