简体   繁体   中英

iPad UISplitView question for Universal App

I am attempting to turn an iPhone app into a Universal App with a simple UISplitView for the iPad. I have added the following to the App Delegate:

> if (UI_USER_INTERFACE_IDIOM() ==
> UIUserInterfaceIdiomPad) {
>         [window addSubview:splitViewController.view]; 
>         [window makeKeyAndVisible];
>     } else {
>         [window addSubview:tabBarController.view]; 
>         [window makeKeyAndVisible];
>     }

However, it doesn't give me the option in IB to add a UISplitViewController in the MainWindow.nib. So, after creating a new nib and adding the App Delegate object, I linked up a SplitViewController with the splitView that I declared in the App delegate - however when I try to run it on the iPad simulator, it is still showing up as an iPhone App running on an iPad. (@ 1/2 size) Any thoughts?

This sounds like an issue with your Project/Build settings rather than code at this point.

Select your Target, choose Get Info and make sure your Targeted Device Family is set to iPad/iPhone on all your build configurations, then do a clean build and try again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM