简体   繁体   English

Xcode 4.2未为通用应用程序创建单独的iPhone,iPad,共享文件夹

[英]Xcode 4.2 not creating separate iPhone, iPad, Shared folders for universal app

I remember in Xcode 4.1, when I choose to create a universal application it would create separate iPhone/iPad/Shared folders with 3 separate appdelegate , with subclassing etc. 我记得在Xcode 4.1中,当我选择创建通用应用程序时,它将创建带有3个单独的appdelegate以及子类化等功能的单独的iPhone / iPad / Shared文件夹。

Just tried this on Xcode 4.2, and I see that it's not creating these folders. 刚刚在Xcode 4.2上尝试过,我发现它没有创建这些文件夹。 Am I doing something wrong or has this changed? 我是在做错什么还是改变了? Am I supposed set all this up myself, or Xcode 4.2 has introduced a better approach for universal apps that I am not aware of? 我是否应该自己设置所有这些内容,还是Xcode 4.2为我不知道的通用应用程序引入了更好的方法?

It has changed in the latest versions. 最新版本已更改。 As opposed to creating separate files for iPhone and iPad, Xcode only creates separate xibs(or storyboards) and uses the following to tell the application to change views if the device is an iPad. 与为iPhone和iPad创建单独的文件相反,Xcode仅创建单独的xib(或情节提要),并使用以下命令告诉应用程序更改视图(如果设备是iPad)。 This allows you to only have to write all your code once. 这样一来,您只需编写一次所有代码即可。

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) 

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

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