首页 > 其他 > 详细

#import vs. @class

时间:2016-03-04 19:13:57      阅读:126      评论:0      收藏:0      [点我收藏+]

You #import or #include when there is a physical dependency. Otherwise, you use forward declarations (@class MONClassstruct MONStruct@protocol MONProtocol).

Here are some common examples of physical dependence:

  • Any C or C++ value (a pointer or reference is not a physical dependency). If you have a CGPoint as an ivar or property, the compiler will need to see the declaration of CGPoint.
  • Your superclass.
  • A method you use.

参考:http://stackoverflow.com/questions/322597/class-vs-import

#import vs. @class

原文:http://www.cnblogs.com/drbbq/p/5242965.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!