简体   繁体   English

iOS - iphone / ipad版本控制

[英]iOS - iphone/ipad versioning

I currently have an iphone app that I want to make an ipad version of. 我目前有一个iphone应用程序,我想制作一个ipad版本。 I don't want it to be "universal" though. 我不希望它是“普遍的”。 I want to sell the ipad version for a different price than the iphone version. 我想以不同于iphone版本的价格出售ipad版本。

My question - what is the best way to go about this in Xcode? 我的问题 - Xcode中最好的解决方法是什么? Do I just copy the project and then maintain two separate projects, and do the ipad build from the new project? 我只是复制项目然后维护两个单独的项目,并从新项目中进行ipad构建吗? Seems this is the only way to go, but will be a pain to make updates to both. 似乎这是唯一的方法,但要对两者进行更新都会很痛苦。 Suggestions? 建议? Advice? 建议吗? Thanks. 谢谢。

In almost the same way that you would make an app universal, you can make a separate iPad version. 几乎与您制作应用程序通用的方式相同,您可以制作单独的iPad版本。 Disclaimer: I haven't actually done this before, I went the universal route. 免责声明:我之前没有真正做到这一点,我走了普遍的路线。 Now what you need to do is first right click on your target and click "Upgrade Current Target for iPad..." Then click "Two device-specific applications" and "OK." 现在您需要做的是首先右键单击您的目标并单击“升级iPad的当前目标...”然后单击“两个设备特定的应用程序”和“确定”。 Good luck. 祝好运。

I went through something similar with my apps. 我和我的应用程序进行了类似的操作。 I had a working iPhone version of an app that I wanted to port to the iPad. 我有一个应用程序的iPhone版本,我想移植到iPad。 I created an iPad-specific project and added the share-able code to this. 我创建了一个特定于iPad的项目,并为此添加了可共享的代码。 Fortunately for me, I had a pretty clean separation of the data and UI code and was able to share most of the data code; 对我来说幸运的是,我对数据和UI代码进行了非常清晰的分离,并且能够共享大部分数据代码; in the new iPad project, the only thing I had to write new code for was the UI stuff. 在新的iPad项目中,我唯一需要编写新代码的是UI内容。

I'm totally open to changing the way I handle this separation. 我完全乐于改变处理这种分离的方式。 In theory, it would seem that you could specify different bundle identifiers and turn on/off settings to enable iPad or iPhone versions. 理论上,您似乎可以指定不同的包标识符并打开/关闭设置以启用iPad或iPhone版本。 But I had decided that it'd just be simpler to separate out my iPad/iPhone projects. 但我已经决定将我的iPad / iPhone项目分开是更简单的。

Hope this helps! 希望这可以帮助!

Instead of using two projects, add an iPad app target to your iPhone project. 将iPad应用程序目标添加到iPhone项目,而不是使用两个项目。 This way, whenever you change shared code, it is updated for both apps. 这样,无论何时更改共享代码,都会针对这两个应用更新共享代码。

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

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