Possible Duplicate:
Best way to programmatically detect iPad/iPhone hardware
For example I want my view to be portrait only on iPhone and landscape on iPad.
How to detect if I'm running on iphone or iPad in this situation?
Possible Duplicate:
Best way to programmatically detect iPad/iPhone hardware
For example I want my view to be portrait only on iPhone and landscape on iPad.
How to detect if I'm running on iphone or iPad in this situation?
Write this in your UIViewController
:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone)
return UIInterfaceOrientationIsPortrait(interfaceOrientation);
else
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}