runtime
一個(gè)c語言庫,OC是C語言的超級,封裝,即OC運(yùn)行時(shí)會(huì)全部轉(zhuǎn)化為C語言,即runtime的函數(shù)庫。
此篇目的是寫所有的runtime函數(shù),打印出來,空閑時(shí)間去看看。
objc.h文件
typedef struct objc_class * Class;
struct objc_object {
Class _Nonnull isa OBJC_ISA_AVAILABILITY;
}
typedef struct objc_object *id;
typedef struct objc_selector *SEL;
typedef void (*IMP)(void /* id, SEL, ...*/)
typedef id _Nullable (* IMP)(id _ Nonnull, SEL _Nonnull, ...)
OBJC_EXPORT const char * _Nonnull sel_getName(SEL _Nonnull sel) OBJC_AVAILABLE (10.0,2.0.9.0...)
OBJC_EXPORT SEL _Nonnull sel_registerName(const char * _Nonnul str)
OBJC_EXPORT const char * _Nonnull object_getClassName(id _Nullable obj)
OBJC_EXPORT void * _Nullable object_getIndexedIvars(id _Nullable obj) OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0)
OBJC_ARC_UNAVAILABLE; (ARC 下不可用)
OBJC_EXPORT BOOL sel_isMapped(SEL _Nonnull sel)
OBJC_EXPORT SEL _Nonnull sel_getUid(const char * _Nonnull str)