my game uses cocos2d landscape mode. when I need to present view controllers, they are also in landscape mode, for example, game center and store view controller.
Store view controller works for ios6 and before (looks a bit weird since the content is still in portrait mode), but it crashes on ios7. game center still works fine.
Note that both store view controller and game center view controller still work perfectly for portrait mode on ios7.
So is it possible to set the store view controller to be portrait only? (while game center view controller still in landscape)
I use this code to present the store view controller:
if ([SKStoreProductViewController class] != nil) {
//create store view controller
SKStoreProductViewController *productController = [[SKStoreProductViewController alloc] init];
productController.delegate = (id<SKStoreProductViewControllerDelegate>)self;
//load product details
NSDictionary *productParameters = @{SKStoreProductParameterITunesItemIdentifier:url};
[productController loadProductWithParameters:productParameters completionBlock:^(BOOL result, NSError *error) {
if (!result) NSLog(@"Error: %@", error);
}];
[[(AppController*)[[UIApplication sharedApplication] delegate] navController] presentViewController:productController animated:YES completion:nil];
} else {
url = [NSString stringWithFormat:@"https://itunes.apple.com/app/id%@?mt=8", url];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]];
}
the url above is an app id string
EDIT:
I tried
productController.view.transform = CGAffineTransformMakeRotation(M_PI / 2);
but still it's still in landscape