Hi
What's the proper way to force an iOS device to set the
orientation to one of
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
UIInterfaceOrientationPortrait
UIInterfaceOrientationPortraitUpsideDown
?
The (relatively new) Wrox book says to do something along the lines of
[[UIDevice currentDevice] setOrientation:<one of the orientation
constants above>];
but both the documentation and the compiler say no. The documentation
states that 'orientation' is a readonly property of the UIDevice
class, and the compiler confirms this with a warning that "UIDevice
may not respond to 'setOrientation:'"
I know you can set the initial orientation in the viewDidLoad method,
but that technique doesn't quite work anywhere else - it'll set the
orientation all right, but the view itself won't act as if that's the
orientation in use... at least on the iPad simulator; haven't tried
uploading it to my iPad yet.
So what is the correct way of programmatically setting the interface
orientation in iOS devices?
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com