I\'m diving into iOS development and I created a universal app that turned into an iPhone-only app. When it runs on the iPad, it just loads a white screen since there\'s no
I think there is an entry in the info.plist file for each of the devices that says which main window to load. Maybe a quick and dirty solution would be to set both MainWindow-iPhone and MainWindow-iPad to the same -iPhone- main window.
Since Xcode 5
, you can chose your development target devices from the Project:
From the devices section within Development Info
, now you can choose:
1-iPhone 2- iPad 3- Universal
When an iPad runs a universal app, how does it know to run it in "iPhone mode" or execute the iPad specific code?
The iPad looks for the Targeted Device Family
, if the iPad is not present, then it knows it must run the app in iPhone mode.
In a universal app, how does it know which code is iPhone and which code is iPad?
When you write the code for the app, you must specify what device you are targeting if there are specific things you need to do per device. (see the code example below)
How can I prevent the iPad from trying to run the iPad code and, instead, run the iPhone code?
Do not support iPad in your Targeted Device Family
. Second, in your code, do not specify that specific code needs a specific device, for example:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
{
/* run something specific for the iPad */
}
else
{
/* run something specific for the iPhone */
}