1

My supports both Landscape & Portrait mode in ios6. I also try with new methods of device rotation, But the methods are not called & it does not support the orientation.

My code is as follow:

-(NSUInteger)supportedInterfaceOrientations
{
    NSLog(@"supportedInterfaceOrientations...");
    return UIInterfaceOrientationMaskAll;
}

-(BOOL)shouldAutorotate
{
    NSLog(@"shouldAutoRotate...");
    return YES;
}

I don't know the issue for this.

Thanks...

user1673099
  • 3,293
  • 7
  • 26
  • 57

2 Answers2

0

Do you support all Interface Orientations in the Target respectively in the Info.plist

Supported Interface Orientations You would need to check all these images to support all Orientations

Maulik
  • 19,348
  • 14
  • 82
  • 137
lukaswelte
  • 2,951
  • 1
  • 23
  • 45
0

Try this,

Because You Mentioned : Deployment target is ios5 but you run the app in ios6.

In .pch File,

#define IOS_OLDER_THAN_6 ( [ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] < 6.0 )

#define IOS_NEWER_OR_EQUAL_TO_6 ( [ [ [ UIDevice currentDevice ] systemVersion ] floatValue ] >= 6.0 )

And In Controller File, Check with Conditions,

#ifdef IOS_OLDER_THAN_6
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {
     return toInterfaceOrientation;
}
#endif

#ifdef IOS_NEWER_OR_EQUAL_TO_6
-(BOOL)shouldAutorotate {
     return YES;
}

- (NSUInteger)supportedInterfaceOrientations {
     return (UIInterfaceOrientationMaskAll);
}
#endif

Hopefully, It will be helpful to you. Thanks.

Manann Sseth
  • 2,745
  • 2
  • 30
  • 50