如何在同一项目中拥有iOS App和OS X App? [英] How do I have an iOS App and OS X App in the same project?

查看:124
本文介绍了如何在同一项目中拥有iOS App和OS X App?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看过

I've seen this question about whether or not it's possible to make an iOS App and a Mac OS X App in the same project, while I was trying to ask this. I'm not asking about whether or not it's possible. I had to delete and re-install Xcode (because I wanted to update and my MacBook Air's SSD is really low on space), and I came across this screenshot.

除了右侧绝对美丽的3D风景外,我还查看了左侧的项目结构.他们将OS X文件放在一个组中,将iOS文件放在另一个组中.

Besides the absolutely beautiful 3D scenery on the right side, I looked at the project structure on the left. They have OS X files in one group and iOS files in another.

如何使我的项目井井有条?这样,我将如何创建一个项目,使OS X文件和iOS文件成为同一项目中的两组不同文件,并几乎同步地在每个应用程序上工作?

How would I be able to make my project this organized? As in, how would I go about making a project where I can simply have OS X files and iOS files be simply two different groups of files in the same project, and work on each app almost synchronously?

推荐答案

弄清楚如何做到这一点,请保留一些屏幕截图,以防可能对其他人有所帮助.

Figure out how to do this, leave some screenshots in case it may help others.

我首先制作了OSX App,将通用代码分开,然后单击文件菜单以将目标创建为iOS App.

I did the OSX App first, put the common code apart, then click file menu to create the target as iOS App.

使用通用代码构建iOS App,现在您已经可以看到目标同时具有OSX和iOS,请记住在编译源和资源"中添加所需的文件.

Use the common code to build iOS App, Now you can already see the target has both OSX and iOS, remember to add the needed files in the Compile Sources and Resources.

现在,您都可以选择在iOS还是OSX上运行.完成!

Now you can both choose whether to run on iOS or OSX. Done!

这篇关于如何在同一项目中拥有iOS App和OS X App?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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