简体   繁体   English

xcode iphone项目和ipad项目进入通用应用程序

[英]xcode iphone project and ipad project into universal app

If I have a project that was written for iphone and a project written for ipad. 如果我有一个为iphone编写的项目和一个为ipad编写的项目。 Is there a recommended way to combine them into a universal app? 是否有推荐的方法将它们组合成通用应用程序?

My understanding is that you would take the existing app (iphone project) and convert it to a universal app then rename the classes to class_iphone, class_ipad etc. 我的理解是,你将采用现有的应用程序(iphone项目)并将其转换为通用应用程序,然后将类重命名为class_iphone,class_ipad等。

The process of coverting includes xcode generating a new MainWindow nib for the ipad and other related files... But this sound painful to go into the project and duplicate the files etc.. 隐蔽的过程包括xcode为ipad和其他相关文件生成一个新的MainWindow笔尖......但是这个声音很难进入项目并复制文件等。

please advise. 请指教。

You may have to rename your NIBs to be iPhone and iPad specific, but you shouldn't have to do that with your classes. 您可能必须将您的NIB重命名为iPhone和iPad特定的,但您不必对您的课程执行此操作。 I am not saying that it won't be painful - just that it will be a different kind of pain. 我并不是说它不会痛苦 - 只是它会是一种不同的痛苦。 You will need to wrap certain code in: 您需要将某些代码包装在:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
    {
    }
else
    {
    }

And you will need to be careful about classes (like UIPopoverController) that are specific to iPads. 你需要注意特定于iPad的类(如UIPopoverController)。

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

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