In Cocoa, how is the id type defined?

后端 未结 5 972
孤独总比滥情好
孤独总比滥情好 2020-12-09 06:02

This question is out of pure curiosity. How does Cocoa define the id type? Is it just a typedef for a void *? Also, if you know which header file it is defined in, I would b

5条回答
  •  抹茶落季
    2020-12-09 06:22

    Hold down the command key and double click on any highlighted term to jump to its definition.

    typedef struct objc_class *Class;
    typedef struct objc_object {
        Class isa;
    } *id;
    
    
    typedef struct objc_selector    *SEL;    
    typedef id          (*IMP)(id, SEL, ...); 
    

提交回复
热议问题