]> git.saurik.com Git - apple/objc4.git/blob - runtime/NSObject.h
objc4-709.tar.gz
[apple/objc4.git] / runtime / NSObject.h
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)
51 OBJC_ROOT_CLASS
52 OBJC_EXPORT
53 @interface NSObject <NSObject> {
54 Class isa OBJC_ISA_AVAILABILITY;
55 }
56
57 + (void)load;
58
59 + (void)initialize;
60 - (instancetype)init
61 #if NS_ENFORCE_NSOBJECT_DESIGNATED_INITIALIZER
62 NS_DESIGNATED_INITIALIZER
63 #endif
64 ;
65
66 + (instancetype)new OBJC_SWIFT_UNAVAILABLE("use object initializers instead");
67 + (instancetype)allocWithZone:(struct _NSZone *)zone OBJC_SWIFT_UNAVAILABLE("use object initializers instead");
68 + (instancetype)alloc OBJC_SWIFT_UNAVAILABLE("use object initializers instead");
69 - (void)dealloc OBJC_SWIFT_UNAVAILABLE("use 'deinit' to define a de-initializer");
70
71 - (void)finalize OBJC_DEPRECATED("Objective-C garbage collection is no longer supported");
72
73 - (id)copy;
74 - (id)mutableCopy;
75
76 + (id)copyWithZone:(struct _NSZone *)zone OBJC_ARC_UNAVAILABLE;
77 + (id)mutableCopyWithZone:(struct _NSZone *)zone OBJC_ARC_UNAVAILABLE;
78
79 + (BOOL)instancesRespondToSelector:(SEL)aSelector;
80 + (BOOL)conformsToProtocol:(Protocol *)protocol;
81 - (IMP)methodForSelector:(SEL)aSelector;
82 + (IMP)instanceMethodForSelector:(SEL)aSelector;
83 - (void)doesNotRecognizeSelector:(SEL)aSelector;
84
85 - (id)forwardingTargetForSelector:(SEL)aSelector OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0);
86 - (void)forwardInvocation:(NSInvocation *)anInvocation OBJC_SWIFT_UNAVAILABLE("");
87 - (NSMethodSignature *)methodSignatureForSelector:(SEL)aSelector OBJC_SWIFT_UNAVAILABLE("");
88
89 + (NSMethodSignature *)instanceMethodSignatureForSelector:(SEL)aSelector OBJC_SWIFT_UNAVAILABLE("");
90
91 - (BOOL)allowsWeakReference UNAVAILABLE_ATTRIBUTE;
92 - (BOOL)retainWeakReference UNAVAILABLE_ATTRIBUTE;
93
94 + (BOOL)isSubclassOfClass:(Class)aClass;
95
96 + (BOOL)resolveClassMethod:(SEL)sel OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0);
97 + (BOOL)resolveInstanceMethod:(SEL)sel OBJC_AVAILABLE(10.5, 2.0, 9.0, 1.0);
98
99 + (NSUInteger)hash;
100 + (Class)superclass;
101 + (Class)class OBJC_SWIFT_UNAVAILABLE("use 'aClass.self' instead");
102 + (NSString *)description;
103 + (NSString *)debugDescription;
104
105 @end
106
107 #endif
108
109 #endif