NSObject.h (3447B) - Raw
1 /* NSObject.h 2 Copyright (c) 1994-2012, Apple Inc. All rights reserved. 3 */ 4 5 #ifndef _OBJC_NSOBJECT_H_ 6 #define _OBJC_NSOBJECT_H_ 7 8 #if __OBJC__ 9 10 #include <objc/objc.h> 11 #include <objc/NSObjCRuntime.h> 12 13 @class NSString, NSMethodSignature, NSInvocation; 14 15 @protocol NSObject 16 17 - (BOOL)isEqual:(id)object; 18 @property (readonly) NSUInteger hash; 19 20 @property (readonly) Class superclass; 21 - (Class)class OBJC_SWIFT_UNAVAILABLE("use 'type(of: anObject)' instead"); 22 - (instancetype)self; 23 24 - (id)performSelector:(SEL)aSelector; 25 - (id)performSelector:(SEL)aSelector withObject:(id)object; 26 - (id)performSelector:(SEL)aSelector withObject:(id)object1 withObject:(id)object2; 27 28 - (BOOL)isProxy; 29 30 - (BOOL)isKindOfClass:(Class)aClass; 31 - (BOOL)isMemberOfClass:(Class)aClass; 32 - (BOOL)conformsToProtocol:(Protocol *)aProtocol; 33 34 - (BOOL)respondsToSelector:(SEL)aSelector; 35 36 - (instancetype)retain OBJC_ARC_UNAVAILABLE; 37 - (oneway void)release OBJC_ARC_UNAVAILABLE; 38 - (instancetype)autorelease OBJC_ARC_UNAVAILABLE; 39 - (NSUInteger)retainCount OBJC_ARC_UNAVAILABLE; 40 41 - (struct _NSZone *)zone OBJC_ARC_UNAVAILABLE; 42 43 @property (readonly, copy) NSString *description; 44 @optional 45 @property (readonly, copy) NSString *debugDescription; 46 47 @end 48 49 50 OBJC_AVAILABLE(10.0, 2.0, 9.0, 1.0, 2.0) 51 OBJC_ROOT_CLASS 52 OBJC_EXPORT 53 @interface NSObject <NSObject> { 54 #pragma clang diagnostic push 55 #pragma clang diagnostic ignored "-Wobjc-interface-ivars" 56 Class isa OBJC_ISA_AVAILABILITY; 57 #pragma clang diagnostic pop 58 } 59 60 #pragma clang diagnostic push 61 #pragma clang diagnostic ignored "-Wobjc-load-method" 62 + (void)load; 63 #pragma clang diagnostic pop 64 65 + (void)initialize; 66 - (instancetype)init 67 #if NS_ENFORCE_NSOBJECT_DESIGNATED_INITIALIZER 68 NS_DESIGNATED_INITIALIZER 69 #endif 70 ; 71 72 + (instancetype)new OBJC_SWIFT_UNAVAILABLE("use object initializers instead"); 73 + (instancetype)allocWithZone:(struct _NSZone *)zone OBJC_SWIFT_UNAVAILABLE("use object initializers instead"); 74 + (instancetype)alloc OBJC_SWIFT_UNAVAILABLE("use object initializers instead"); 75 - (void)dealloc OBJC_SWIFT_UNAVAILABLE("use 'deinit' to define a de-initializer"); 76 77 - (void)finalize OBJC_DEPRECATED("Objective-C garbage collection is no longer supported"); 78 79 - (id)copy; 80 - (id)mutableCopy; 81 82 + (id)copyWithZone:(struct _NSZone *)zone OBJC_ARC_UNAVAILABLE; 83 + (id)mutableCopyWithZone:(struct _NSZone *)zone OBJC_ARC_UNAVAILABLE; 84 85 + (BOOL)instancesRespondToSelector:(SEL)aSelector; 86 + (BOOL)conformsToProtocol:(Protocol *)protocol; 87 - (IMP)methodForSelector:(SEL)aSelector; 88 + (IMP)instanceMethodForSelector:(SEL)aSelector; 89 - (void)doesNotRecognizeSelector:(SEL)aSelector; 90 91 - (id)forwardingTargetForSelector:(SEL)aSelector OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); 92 - (void)forwardInvocation:(NSInvocation *)anInvocation OBJC_SWIFT_UNAVAILABLE(""); 93 - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector OBJC_SWIFT_UNAVAILABLE(""); 94 95 + (NSMethodSignature *)instanceMethodSignatureForSelector:(SEL)aSelector OBJC_SWIFT_UNAVAILABLE(""); 96 97 - (BOOL)allowsWeakReference UNAVAILABLE_ATTRIBUTE; 98 - (BOOL)retainWeakReference UNAVAILABLE_ATTRIBUTE; 99 100 + (BOOL)isSubclassOfClass:(Class)aClass; 101 102 + (BOOL)resolveClassMethod:(SEL)sel OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); 103 + (BOOL)resolveInstanceMethod:(SEL)sel OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0, 2.0); 104 105 + (NSUInteger)hash; 106 + (Class)superclass; 107 + (Class)class OBJC_SWIFT_UNAVAILABLE("use 'aClass.self' instead"); 108 + (NSString *)description; 109 + (NSString *)debugDescription; 110 111 @end 112 113 #endif 114 115 #endif