Can anyone confirm that to support both iOS 6 and iOS 5 there is no point to adding the new iOS 6 autorotation methods, since the Apple docs suggest that these methods are completely ignored if you are also implementing the iOS 5 methods?
In particular, I talking about the methods - (NSUInteger)supportedInterfaceOrientations
and - (BOOL) shouldAutorotate
-- that these are ignored and synthesized by the compiler if you also implement the - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
For iOS5 Rotation. Check for your desired orientation and return YES
iOS 6.0 Autorotation Support
You need to add new callback for autorotation if you are packaging your app in the new sdk. However, these callbacks will be received only when such an app is run on iOS 6 devices. For devices running on earlier iOS versions, earlier callbacks would be received. If you dont implement the new callbacks, the default behavior is that your app runs on all orientation on iPad and all except UpsideDown orientation on iPhone.
I think the most elegant solution is:
Do I miss something?
You have to set a flag somewhere (I believe in your Info.plist) that indicates which of the two you use. If you use the new one, you can't build for iOS 5 (or at least, it won't work on iOS 5). If you use the old one, the new methods aren't being called. So yeah, you pretty much have to choose which method(s) you want to use, and if you want to support iOS 5, you cannot use the new methods.
to support autorotations in both ios5 and ios6 we need to provide call backs in case of ios6....
and we need to call
for ios5
-(void)viewWillLayoutSubviews this method will call for ios5/ios6. this code is usefull to both ios6/ios5/ios6 with 3.5" screen/4" screen with ios6.