[cfe-dev] id and ObjC interfaces

Fariborz Jahanian fjahanian at apple.com
Sat Apr 25 18:29:57 PDT 2009


Type for 'id' is:

typedef struct objc_object {
     Class isa;
} *id;

'id' gcc and clang predefine this type. It is essentially a 'void *'  
for objective-c object pointers.
This does not mean that ObjC interfaces inherit 'id'. It does mean  
that ObjC object pointers can be
assigned back and force to objects of this type.

- Fariborz

On Apr 24, 2009, at 9:04 PM, Zhongxing Xu wrote:

> 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?
>
> -Zhongxing
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list