- + (void) load;
- //两个初始化的方法,一个类方法,一个实例方法。
- + (void) initialize;
- //实例话对象
- - (instancetype) init;
- //创建对象也可以用 new
- + (instancetype) new;
- //和copyWithZone一样官方的解释是
- //This method exists for historical reasons; memory zones are no longer used by Objective-C.
- + (instancetype) allocWithZone: (struct _NSZone * ) zone;
- //初始化类时调用alloc来分配内存空间
- + (instancetype) alloc;
- //使用ARC之后不再使用这个方法,(之前是销毁对象)
- - (void) dealloc; - (void) finalize;
- //copy会拷贝一份该类的引用
- - (id) copy;
- //和上面类似
- - (id) mutableCopy;
- //同allocWithZone类似但是没有仔细分析过
- + (id) copyWithZone: (struct _NSZone * ) zone OBJC_ARC_UNAVAILABLE; + (id) mutableCopyWithZone: (struct _NSZone * ) zone OBJC_ARC_UNAVAILABLE;
- //下面这些方法没有接触过,暂时解释不了。
- + (BOOL) instancesRespondToSelector: (SEL) aSelector; + (BOOL) conformsToProtocol: (Protocol * ) protocol; - (IMP) methodForSelector: (SEL) aSelector; + (IMP) instanceMethodForSelector: (SEL) aSelector; - (void) doesNotRecognizeSelector: (SEL) aSelector; - (id) forwardingTargetForSelector: (SEL) aSelector __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); - (void) forwardInvocation: (NSInvocation * ) anInvocation; - (NSMethodSignature * ) methodSignatureForSelector: (SEL) aSelector; + (NSMethodSignature * ) instanceMethodSignatureForSelector: (SEL) aSelector; - (BOOL) allowsWeakReference UNAVAILABLE_ATTRIBUTE; - (BOOL) retainWeakReference UNAVAILABLE_ATTRIBUTE;
- //返回是不是一个类的字类的真假值
- + (BOOL) isSubclassOfClass: (Class) aClass;
- //这两个暂时没接触
- + (BOOL) resolveClassMethod: (SEL) sel __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); + (BOOL) resolveInstanceMethod: (SEL) sel __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0); + (NSUInteger) hash; //返回一个hash内存地址
- + (Class) superclass; //返回该类的父类
- + (Class) class; //返回该类的类名
- + (NSString * ) description; //类似java的类的toString方法
- + (NSString * ) debugDescription;
来源: http://lib.csdn.net/snippet/objective-c/49145