[cfe-dev] id and ObjC interfaces
Jean-Daniel Dupas
devlists at shadowlab.org
Sat Apr 25 01:33:49 PDT 2009
Le 25 avr. 09 à 06:04, Zhongxing Xu a écrit :
> Hi all,
>
> In clang, type 'id' is implemented as 'typedef struct objc_object *'.
> And 'id' can points to any ObjC objects. Does that mean that all ObjC
> interfaces inherits 'struct objc_object' implicitly?
>
I don't know how clang handle this but AFAK, the first ivar of a root
class must be a pointer on the object class (usually named isa) (this
is the case for NSObject and NSProxy for example).
So, an interface should not inherit struct objc_object, else the isa
pointer will be defined twice.
More information about the cfe-dev
mailing list