struct objc_class *Class

Base 클래스인 NSObject의 헤더에는 다음과 같이 선언되어 있습니다.

@interface NSObject <NSObject>
{
  Class isa;
}

isa는 클래스 타입의 변수로 모든 인스턴스 객체는 이 isa에 의해 자신이 속한 클래스 객체를 참조합니다. 이것은 objc/objc.h 에 다음과 같이 정의되어 있습니다.

struct objc_class *Class;

그리고 이 구조체는 다음과 같은 내용을 담고 있습니다.

struct objc_class {
    struct objc_class *isa;
    struct objc_class *super_class;
    const char *name;
    long version;
    long info;
    long instance_size;
    struct objc_ivar_list *ivars;
    struct objc_method_list **methodLists;
    struct objc_cache *cache;
    struct objc_protocol_list *protocols;
};
http://macdevcenter.com/pub/a/mac/2002/05/31/runtime_parttwo.html?page=2

Posted by Enowy

2009/10/27 14:13 2009/10/27 14:13
, , , , , ,
Response
No Trackback , 20 Comments
RSS :
http://enowy.com/blog/rss/response/161