picofuse-objc

Instance Methods | Class Methods | Protected Attributes | List of all members
Object Class Reference

The root class of all Objective-C classes. More...

#import <runtime/gcc/objc.h>

Inheritance diagram for Object:
Inheritance graph
[legend]
Collaboration diagram for Object:
Collaboration graph
[legend]

Instance Methods

(id) - init
 Initialize the instance, after allocation. More...
 
(Class) - class
 Returns the class of the instance. More...
 
(Class) - superclass
 Returns the superclass of the instance. More...
 
(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...
 
- Instance Methods inherited from <ObjectProtocol>
(BOOL) - respondsToSelector:
 Checks if the receiver responds to a selector. More...
 

Class Methods

(void) + initialize
 Performs one-time initialization for the class. More...
 
(Class) + class
 Returns the class object. More...
 
(Class) + superclass
 Returns the superclass of the class. More...
 
(const char *) + name
 Returns the name of the class. More...
 
(BOOL) + conformsTo:
 Checks if the class conforms to a protocol. More...
 

Protected Attributes

Class isa
 A pointer to the object's class structure. More...
 

Detailed Description

The root class of all Objective-C classes.

This class is the base class for all objects in Objective-C. It provides introspection capabilities, but not memory management. Inherit from NXObject for objects which can be allocated.

Definition at line 20 of file Object.h.

Method Documentation

◆ class() [1/2]

- (Class) class

Returns the class of the instance.

Returns
The class of the receiver.

◆ class() [2/2]

+ (Class) class

Returns the class object.

Returns
The class object for the receiver.

◆ conformsTo:() [1/2]

- (BOOL) conformsTo: (Protocol *)  aProtocolObject

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.

This instance method determines whether the receiving object's class adopts or inherits from the specified protocol. This is equivalent to calling the class method on the receiver's class.

Reimplemented from <ObjectProtocol>.

Implemented in Protocol.

◆ conformsTo:() [2/2]

+ (BOOL) conformsTo: (Protocol *)  aProtocolObject

Checks if the class conforms to a protocol.

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

This class method determines whether the receiving class adopts or inherits from the specified protocol. A class conforms to a protocol if it explicitly declares that it adopts the protocol, or if it inherits from a class that conforms to the protocol.

Reimplemented from <ObjectProtocol>.

Implemented in Protocol.

◆ init()

- (id) init

Initialize the instance, after allocation.

Returns
The initialized object.

Subclasses should override this method to perform custom initialization, and free resources if the initialization fails.

Implemented in NXRunLoop, NXDate, NXCondition, NXLock, and NXWaitGroup.

◆ initialize()

+ (void) initialize

Performs one-time initialization for the class.

This method is called automatically by the Objective-C runtime before the class receives messages.

Subclasses may override this method to perform initialization tasks like setting up class variables or initializing static data structures. If subclasses implement this method, they are called first, and may be called multiple times.

◆ isEqual:()

- (BOOL) isEqual: (id)  anObject

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 from <ObjectProtocol>.

Implemented in NXDate, NXString, NXMap, NXArray, NXNumber, NXColor, and NXData.

◆ isKindOfClass:()

- (BOOL) isKindOfClass: (Class)  cls

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 from <ObjectProtocol>.

◆ name()

+ (const char *) name

Returns the name of the class.

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

Reimplemented from <ObjectProtocol>.

Implemented in NXSensorEvent, NXWirelessNetwork, NXEnvironment, NXArgument, and Protocol.

◆ superclass() [1/2]

- (Class) superclass

Returns the superclass of the instance.

Returns
The superclass of the receiver, or Nil if it is a root class.

◆ superclass() [2/2]

+ (Class) superclass

Returns the superclass of the class.

Returns
The superclass of the receiver, or Nil if it is a root class.

Member Data Documentation

◆ isa

- isa
protected

A pointer to the object's class structure.

This instance variable holds a reference to the class to which the object belongs. It is a fundamental part of the Objective-C object model, enabling dynamic dispatch and introspection.

Definition at line 29 of file Object.h.


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