My applications have additional features for iPhone 5, and I created a separate class with .xib for it. I would like to determine the height of the screen (unless it is possible to get the device identifier / model) and load another view controller accordingly. I tried this:
- (IBAction)select:(id)sender { CGRect screenRect = [[UIScreen mainScreen] bounds]; CGFloat screenWidth = screenRect.size.width; CGFloat screenHeight = screenRect.size.height; if (screenHeight == 960) { Selection *selectView =[[Selection alloc] initWithNibName:nil bundle:nil]; selectView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:selectView animated:YES]; } else { Selection_5 *selectView =[[Selection_5 alloc] initWithNibName:nil bundle:nil]; selectView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve; [self presentModalViewController:selectView animated:YES]; } }
Choice and Choice_5 are two different classes, each of which is different from xib for the user interface.
ios objective-c iphone xcode ipad
Dale townsend
source share