Q:

How to find out the simulator orientations?

iam developing one app .In that i want to find out the iphone orientations.I written the code for that one.Is there any way to find out the simulator orientations.

A:

Jeremy's answer is missing an exceedingly important piece of information about [[UIDevice currentDevice] orientation] - as per the Apple documents:

The value of this property always returns 0 unless orientation notifications have been enabled by calling beginGeneratingDeviceOrientationNotifications.

Before you call [[UIDevice currentDevice] orientation] you must first call [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications].
When you're done, you should also call endGeneratingDeviceOrientationNotifications at some point.
However, it is worth noting that the simulator can at times fail to pass orientation changes through: I would strongly recommend testing your orientation changes on a device. There are edge cases you won't see on the simulator that will definitely occur on actual hardware.

