Friday, September 5, 2014

Objective-C:Data types


  • Class
  • Method
  • Ivar
  • Category
  • objc_property_t
  • IMP
  • SEL
  • objc_method_description
  • objc_cache
  • objc_property_attribute_t
  • id
  • objc_object
  • objc_super
  • BOOL
  • objc_AssociationPolicy


/* Class */
typedef struct objc_class *Class;

/* Method */
typedef struct objc_method *Method;

/* Ivar */
typedef struct objc_ivar *Ivar;

/* Category */
typedef struct objc_category *Category;

/* objc_property_t */
typedef struct objc_property *objc_property_t;

/* IMP */
id (*IMP)(id, SEL, ...)

/* SEL */
typedef struct objc_selector *SEL;

/* objc_method_description */
struct objc_method_description {
    SEL name;
    char *types;
};

/* objc_cache */
struct objc_cache {
    unsigned int mask;
    unsigned int occupied;
    Method buckets[1];
};

/* objc_property_attribute_t */
typedef struct {
    const char *name;
    const char *value;
} objc_property_attribute_t;

/* id */
typedef struct objc_object *id;

/* objc_object */
struct objc_object {
    Class isa;
};

/* objc_super */
struct objc_super {
    id receiver;
    Class class
};

/* BOOL */
typedef signed char BOOL;

/* objc_AssociationPolicy */
typedef uintptr_t objc_AssociationPolicy;

No comments: