At a certain point in my application, I would like to temporarily disable the rotation feature - effectively "lock" the orientation in code, similar to what the lock toggle switch does on the iPad in hardware.
I'm currently doing:
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications]
and when I'm through, I call:
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]
While this all appears to work, the API documentation indicates there should always be a begin followed by an end - and I'm doing it essentially in reverse. Is there a more appropriate API for handling the "lock orientation"?