简体   繁体   English

如何在Xcode 4.2中将iPhone应用程序升级到iPad应用程序?

[英]How can I upgrade an iPhone app to iPad app in xcode 4.2?

I have upgraded my iPhone app to universal by right right clicking the project target and selecting duplicate option. 通过右键单击项目目标并选择重复选项,我已将iPhone应用程序升级为通用应用程序。 Then there was 2 choices-duplicate only and 'duplicate and transition to iPad'. 然后有2个选择-仅重复和“重复并过渡到iPad”。 I choose second one. 我选择第二个。 Then a group of iPad XIB files(having same name as iPhone XIBs) called Resources_iPad is automatically added to the app. 然后,将一组名为Resources_iPad的iPad XIB文件(与iPhone XIB的名称相同)自动添加到应用程序中。 But still when I choose iPad simulator to run the project, the app chooses only iphone XIBs. 但是当我选择iPad模拟器来运行该项目时,该应用程序仅选择iphone XIB。 Can anyone help me to resolve this problem? 谁能帮我解决这个问题?

转到目标(或项目)设置,并检查“ Targeted Device Family设置为iPhone/iPad

Any XIBs loaded in code will still load the iPhone version. 任何以代码加载的XIB仍将加载iPhone版本。 You should use UIUserInterfaceIdiom() to determine which XIB to load. 您应该使用UIUserInterfaceIdiom()确定要加载的XIB。 Also make sure you have correctly set your iPad interface file in Info.plist if you specify your iPhone one there. 如果在其中指定了iPhone,请确保已在Info.plist中正确设置了iPad接口文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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