作者whitefur (白毛)
看板MacDev
标题[心得] @class directive
时间Tue Jul 23 14:53:11 2013
当Core Data的entity间有relationship时
该entity的subclass of NSManagedObject的header file会看到@class的用法
基本上
@class MyClass的效果跟#import "MyClass"类似
只不过@class 只告诉complier
「MyClass是一个class」
但没有告诉compiler其它的资讯 ex:method, property
这里有一篇在谈@class directive
分享给大家
http://www.iosappsforeveryone.com/Chapter2Part6ReferencingClasses.htm
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 61.230.79.222
1F:推 Killercat:这个可能要写过c/c++的人比较好理解为什麽要这样做 =P 07/24 09:28
2F:→ Killercat:我是不知道obj-c这样能不能减低过大的相依性让编译速度 07/24 09:30
3F:→ Killercat:以及整个结构都变好就是... 07/24 09:30
4F:推 issuemylove:专有名词应该是 forward declare 07/25 11:12
5F:推 wfgh:文章里就有提到了吧 forward declaration 07/25 13:39