my first application that was just for the iPhone I decided to also implement the ability to be used on the iPad and the first thing I wanted to choose the view to use if it were in the opening of an iPhone or iPad, in my delegate I wrote :
NSString *devy = [[UIDevice currentDevice]model];
if ([devy isEqualToString:@"iPad"]) {
[window addSubview:viewController.viewCpuIpad];
[window makeKeyAndVisible];
} else {
[window addSubview:viewController.view];
[window makeKeyAndVisible];
}
When the iPhone’s okay, but when I open it on the iPad only displays a blank screen …. where wrong?
thanks
Apple’s recommended way (taken from Xcode’s universal application project template) is:
If you don’t want to use IB, you can create your view in view controller’s loadView method like:
(UI_USER_INTERFACE_IDIOM() is a macro to support iOS 3.1 and earlier.)