将 ipad 应用程序转换为 iphone.通用应用 [英] Convert ipad application to iphone. Universal app

查看:49
本文介绍了将 ipad 应用程序转换为 iphone.通用应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将 iPad 应用程序转换为 iPhone-通用应用程序.

Convert iPad application to iPhone- Universal app.

我已经有一个 iPad 应用程序,现在我想为那个 iPad 应用程序制作一个通用应用程序.

I already have one iPad application, now I want to make a universal app of that iPad application.

如何转换?是否可以?还是我必须启动一个新应用?

How to convert? Is it possible? Or do I have to start a new app?

推荐答案

在 Interface Builder 中打开您的项目.单击Targets"旁边的显示三角形,然后右键单击目标并选择Upgrade Current Target for iPad...".

Open up your project in Interface Builder. Click on the disclosure triangle next to "Targets", then right-click on the target and choose "Upgrade Current Target for iPad...".

然后阅读 iPad 编程指南,尤其是 开始你的项目.

Then read the iPad Programming Guide, especially the section Starting Your Project.

我现在明白了——从 iPad 到 iPad/iPhone.

I see now -- iPad to iPad/iPhone.

我认为您会执行以下操作:

I think you would do something like the following:

  1. 为 iPhone 创建一个 .xib主窗口/应用程序委托/等,以对应您现有的 .xibiPad.
  2. 在您的信息列表中添加一个条目:NSMainNibFile,其值为您的新 iPhone xib 的名称
  3. 转到您的构建设置并设置基础 SDK 到 4.1(或者 4.0,如果你仍然安装旧版 SDK)
  4. 保持您的 iOS 部署目标如果您只是在 3.2 构建设置担心 iPhone 和 iPod涉及 4.x.
  5. 设置目标设备系列构建设置为 iPhone/iPad
  6. 开始重构您的代码以创建两个不同的代码路径,一个一个用于 iPhone,一个用于 iPad,其中合适.
  1. Create a .xib for the iPhone for the Main Window/App Delegate/etc, to corresspond your existing .xib for iPad.
  2. Add an entry in your info plist: NSMainNibFile, with the value of the name of your new iPhone xib
  3. Go to your build settings and set the Base SDK to 4.1 (or 4.0 if you still have the older SDK installed)
  4. Keep your iOS Deployment Target build setting at 3.2 if you're only worried about iPhones and iPod Touches with 4.x.
  5. Set the Targeted Device Family build setting to iPhone/iPad
  6. Start refactoring your code to create two different code paths, one for iPhone and one for iPad, where appropriate.

这篇关于将 ipad 应用程序转换为 iphone.通用应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆