O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

NSObject — Mac OS X 10.0

Synopsis

This protocol defines the interface for so-called first-class objects . Objects that conform to the NSObject protocol are able to provide a great deal of information about themselves to other objects, such as their classnames, superclass names, and the protocols that they conform to. Additionally, this protocol declares methods that clients use to determine whether an object can respond to an arbitrary message. Finally, the NSObject protocol declares methods that allow objects to participate in Cocoa’s memory management system. In the Foundation framework, the two root classes NSObject and NSProxy conform to this protocol.

@protocol NSObject
                                  // Instance Methods
   - (BOOL)isEqual:(id)object;
   - (unsigned)hash;
   - (Class)superclass;
   - (Class)class;
   - (id)self;
   - (NSZone *)zone;
   - (id)performSelector:(SEL)aSelector;
   - (id)performSelector:(SEL)aSelector 
                                 withObject:(id)object;
   - (id)performSelector:(SEL)aSelector 
                                 withObject:(id)object1 
                                 withObject:(id)object2;
   - (BOOL)isProxy;
   - (BOOL)isKindOfClass:(Class)aClass;
   - (BOOL)isMemberOfClass:(Class)aClass;
   - (BOOL)conformsToProtocol:(Protocol *)aProtocol;
   - (BOOL)respondsToSelector:(SEL)aSelector;
   - (id)retain;
   - (oneway void)release;
   - (id)autorelease;
   - (unsigned)retainCount;
   - (NSString *)description;
@end

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required