How can I programmatically check whether the device orientation is locked in iOS? I see nothing in UIDevice. I know that this is supposed to be transparent to the app. But I
You can use the UIAccelerometer class to determine the phone's orientation in great detail. If the acceleration vector enters a state where its largest absolute component is on the X axis, that is a landscape orientation. In theory this could be used to detect the orientation lock: if, within a few seconds of this happening, the controller does NOT receive a call to shouldRotateToInterfaceOrientation, and the [[UIDevice currentDevice] orientation] property is not in landscape, you could then safely assume the user has the orientation locked.
This complicated, and has a delay because shouldRotateToInterfaceOrientation will be called well after the actual vector has actually entered a landscape region. The whole idea is a bit of a hack, and you should probably reconsider why you really need to present landscape views when the user has a preference not to show them.