If you are using cocos2d v2.1, you can try this for Portrait.
-(NSUInteger)supportedInterfaceOrientations {
// iPhone only
if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone )
return UIInterfaceOrientationMaskPortrait;
// iPad only
return UIInterfaceOrientationMaskPortrait;
}
// Supported orientations. Customize it for your own needs
// Only valid on iOS 4 / 5. NOT VALID for iOS 6.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// iPhone only
if( [[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone )
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
// iPad only
// iPhone only
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
}
The supported Orientations and auto rotate Orientations should be the same.