在Cocoa中,如何定义id类型? [英] In Cocoa, how is the id type defined?

查看:118
本文介绍了在Cocoa中,如何定义id类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题出于纯粹的好奇心。 Cocoa如何定义id类型?它只是一个void *的typedef?

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 be interested in taking a look.

推荐答案

如果你知道它定义了哪个头文件,我会感兴趣的。命令键并双击任何突出显示的术语以跳转到其定义。

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, ...); 

这篇关于在Cocoa中,如何定义id类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆