Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
Set different supportedInterfaceOrientations for UIViewControllers
So, as by the question, I use the following code to set userinterfaceOrientation for the viewcontrollers.
- (BOOL) shouldAutorotate
{
return YES;
}
-(NSUInteger)supportedInterfaceOrientations
{
return UIInterfaceOrientationMaskPortrait;
}
I tried setting UIInterfaceOrientationMaskAll for another viewController.
Prior, I checked all the items for 'Supported interface orientations' in the 'info-plist'. Both the viewControllers returned true(as set in the info-plist) for all the orientations and didn't obey the above code. It worked even in the absence of the above code.
Is there anyway to restrict certain Supported interface orientations for particular classes? I made it working for the 'pre - iOS6' versions by following as in
this link.
0 •
Replies
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThanks for sharing though -- : )
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeI can only limit which orientation to use in whole app if I add this to appdelegate.m :
- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
return (UIInterfaceOrientationMaskPortrait);
}
But, I need that my first view will be Portrait only, and my second view should support all orientations.
If I add this to my second view, It doesn't work:
- (BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations {
return (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeLeft |
UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskPortraitUpsideDown);
}
Thanks for any help.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome