@class我可以知道这个的正确用法吗 [英] @class May I know the proper use of this

查看:68
本文介绍了@class我可以知道这个的正确用法吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以使用@class指出文档或详细讨论. 我一直在使用它,但并没有完全理解它. 我想了解更多并完全理解它.

谢谢.

解决方案

@class用于

另请参阅:
SO:类与导入
MacRumors

注意:正如 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屋!

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