是否可以在同一个项目中同时拥有iOS应用和Mac应用? [英] Is it possible to have both an iOS app and Mac app in the same project?

查看:120
本文介绍了是否可以在同一个项目中同时拥有iOS应用和Mac应用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如标题所示,我想知道在同一个项目中同时拥有iOS应用程式和Mac应用程式是否合理。也就是说,一个具有Mac应用目标和iOS目标的Xcode项目。

As the title says, I'm wondering if it's possible and reasonable to have both an iOS app and Mac app in the same project. That is, an Xcode project that has a Mac app target, and an iOS target.

如果是这样,我应该注意什么,这是一个好主意。

If so, what should I watch out for, and is this even a good idea.

一个上下文:我正在开发一个web服务的客户端应用程序,它将共享大量的API连接(模型层)代码iOS和Mac平台。

A little context: I'm working on a client app for a web-service, that will share a lot of the API connection (model-layer) code between the iOS and Mac platforms.

推荐答案

这样做很简单。确保您为每个目标设置了适当的构建设置Base SDK。

It's quite straightforward to do this. Make sure you have the build setting "Base SDK" set appropriately for each target.

您还可以通过点击下一个到建立设置:

You can also add SDK-specific build settings by clicking the little (+) symbol next to a build setting:

,然后你可以创建适当的Xcode方案来一次性构建所有内容。

and then you can create appropriate Xcode schemes to build everything at once.

这篇关于是否可以在同一个项目中同时拥有iOS应用和Mac应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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