NSObject頭文件解析
當(dāng)我們需要自定義類都會(huì)創(chuàng)建一個(gè)NSObject子類, 比如:
#import <Foundation/Foundation.h>@interface ClassA : NSObject@end
那么NSObject里面具體有什么呢? 我們點(diǎn)到它的頭文件里面去看看
NSObject <NSObject>+ (+ (- NS_ENFORCE_NSOBJECT_DESIGNATED_INITIALIZER+ (instancetype) OBJC_SWIFT_UNAVAILABLE(+ (instancetype)allocWithZone:( _NSZone *)zone OBJC_SWIFT_UNAVAILABLE(+ (instancetype)alloc OBJC_SWIFT_UNAVAILABLE(- ()dealloc OBJC_SWIFT_UNAVAILABLE(- ()finalize OBJC_DEPRECATED(- (- (+ ()copyWithZone:( _NSZone *+ ()mutableCopyWithZone:( _NSZone *++ (BOOL)conformsToProtocol:(Protocol *-+- (- ()forwardingTargetForSelector:(SEL)aSelector OBJC_AVAILABLE(, , , - ()forwardInvocation:(NSInvocation *)anInvocation OBJC_SWIFT_UNAVAILABLE(- (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector OBJC_SWIFT_UNAVAILA