objc

Instance Methods | Class Methods
<ObjectProtocol> Protocol Reference

Protocol for objects. More...

#import <objc/objc.h>

Inheritance diagram for <ObjectProtocol>:
Inheritance graph
[legend]

Instance Methods

(BOOL- isEqual:
 Compares the receiver to another object for equality. More...
 
(BOOL- isKindOfClass:
 Returns a Boolean value that indicates whether the receiver is an instance of a given class. More...
 
(BOOL- conformsTo:
 Checks if the receiver's class conforms to a protocol. More...
 
(BOOL- respondsToSelector:
 Checks if the receiver responds to a selector. More...
 

Class Methods

(const char *) + name
 Returns the name of the class. More...
 

Detailed Description

Protocol for objects.

The ObjectProtocol defines the minimal interface that objects must implement to provide basic object introspection functionality.

Definition at line 17 of file Object+Protocol.h.

Method Documentation

◆ conformsTo:()

- (BOOL) conformsTo: (Protocol *)  aProtocolObject
required

Checks if the receiver's class conforms to a protocol.

Parameters
aProtocolObjectThe protocol to check conformance against.
Returns
YES if the receiver's class conforms to the specified protocol, NO otherwise.

Reimplemented in Object, Object, and Protocol.

◆ isEqual:()

- (BOOL) isEqual: (id anObject
required

Compares the receiver to another object for equality.

Parameters
anObjectThe object to compare with the receiver.
Returns
YES if the objects are equal, otherwise NO.

When comparing two objects, this method should be overridden to compare the contents of the objects.

Reimplemented in Object.

◆ isKindOfClass:()

- (BOOL) isKindOfClass: (Class cls
required

Returns a Boolean value that indicates whether the receiver is an instance of a given class.

Parameters
clsA class object.
Returns
YES if the receiver is an instance of cls or an instance of any class that inherits from cls, otherwise NO.

Reimplemented in Object.

◆ name()

+ (const char *) name
staticrequired

Returns the name of the class.

Returns
A C-string containing the name of the class.

Reimplemented in Object, and Protocol.

◆ respondsToSelector:()

- (BOOL) respondsToSelector: (SEL aSelector
required

Checks if the receiver responds to a selector.

Parameters
aSelectorThe selector to check for.
Returns
YES if the receiver responds to the specified selector, NO otherwise.

The documentation for this protocol was generated from the following file: