Xcode:复制标题:公开还是私人还是项目? [英] Xcode: Copy Headers: Public vs. Private vs. Project?

查看:270
本文介绍了Xcode:复制标题:公开还是私人还是项目?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个Cocoa Touch静态库。我应该如何决定是否将头文件复制为public,private或project?

I'm building a Cocoa Touch Static Library. How should I decide whether to copy a header file as public, private, or project?

推荐答案


公开:界面已完成并且意味着您的产品客户将使用该界面。公共标题包含在产品中作为可读的源代码,不受任何限制。

Public: The interface is finalized and meant to be used by your product’s clients. A public header is included in the product as readable source code without restriction.

私人:界面不适合您的客户,在发展的早期阶段。产品中包含私人头文件,但标记为私人。因此,符号对所有客户都是可见的,但客户应该明白他们不应该使用它们。

Private: The interface isn’t intended for your clients or it’s in early stages of development. A private header is included in the product, but it’s marked "private". Thus the symbols are visible to all clients, but clients should understand that they're not supposed to use them.

项目:界面是仅供当前项目中的实现文件使用。项目标题不包含在目标中,目标代码除外。这些符号对客户来说根本不可见,仅限于您。

Project: The interface is for use only by implementation files in the current project. A project header is not included in the target, except in object code. The symbols are not visible to clients at all, only to you.

来源: Xcode Developer Library>工具&语言> IDE>项目编辑器帮助>设置头文件的可见性

Source: Xcode Developer Library > Tools & Languages > IDEs > Project Editor Help > Setting the Visibility of a Header File

这篇关于Xcode:复制标题:公开还是私人还是项目?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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