UIKIT_EXTERN_CLASS 和 UIKIT_EXTERN,这两个常量是什么? [英] UIKIT_EXTERN_CLASS and UIKIT_EXTERN, for what these 2 constants are?

查看:60
本文介绍了UIKIT_EXTERN_CLASS 和 UIKIT_EXTERN,这两个常量是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在文档中定义类时,我总是在@interface 之前看到这两个东西(UIKIT_EXTERN_CLASS 和 UIKIT_EXTERN),这些常量代表什么以及为什么 Apple 把它放在它们的类之前?

When i go to definition of classes in documentation, i always see these 2 things (UIKIT_EXTERN_CLASS and UIKIT_EXTERN) before the @interface, what these constants stand for and why Apple put it before their classes?

还有一件事,有文件 UIKitDefines.h,它包含所有这些定义/常量.

And one more thing, there is file UIKitDefines.h and it has all these definitions/constants.

#ifdef __cplusplus
#define UIKIT_EXTERN        extern "C" __attribute__((visibility ("default")))
#else
#define UIKIT_EXTERN            extern __attribute__((visibility ("default")))
#endif

#define UIKIT_STATIC_INLINE static inline
#define UIKIT_EXTERN_CLASS  __attribute__((visibility("default")))

推荐答案

看一看 此页面 来自 Apple 的开发人员文档.本质上,这些宏似乎允许您控制某些符号对应用程序其余部分的可见性.

Take a look at this page from Apple's developer documentation. In essence, it appears those macros allow you to control the visibility of certain symbols to the rest of your application.

这篇关于UIKIT_EXTERN_CLASS 和 UIKIT_EXTERN,这两个常量是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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