@class我可以知道这个的正确用法吗 [英] @class May I know the proper use of this
问题描述
任何人都可以使用@class指出文档或详细讨论. 我一直在使用它,但并没有完全理解它. 我想了解更多并完全理解它.
谢谢.
注意:正如 Richard所指出的那样J. Ross III ,@class
关键字允许循环引用(当两个类彼此依赖时)而不会破坏构建.
Anyone can point out a documentation or a detailed discussion using @class. I've been using this but haven't really fully understood it. I want to learn more about it and fully understand it.
Thank you in advance.
@class
is used to declare a class. Essentially telling the compiler: "Hey, there is a class with this name somewhere in the source code. The definition will come later, but let me use its name as a pointer type for now."
See also:
developer.apple.com
SO: Class vs Import
MacRumors
Note: As pointed out by Richard J. Ross III, the @class
keyword allows for circular references (when two classes both depend on each-other) without breaking the build.
这篇关于@class我可以知道这个的正确用法吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!