Objective-C Runtime Utilities

Interact with the Objective-C runtime.

Topics

Type Lookup

NSClassFromString

Obtains a class by name.

NSStringFromClass

Returns the name of a class as a string.

NSSelectorFromString

Returns the selector with a given name.

NSStringFromSelector

Returns a string representation of a given selector.

NSStringFromProtocol

Returns the name of a protocol as a string.

NSProtocolFromString

Returns a the protocol with a given name.

Serialization

NSGetSizeAndAlignment

Obtains the actual size and the aligned size of an encoded type.

Object Allocation and Deallocation

NSAllocateObject

Creates and returns a new instance of a given class.

NSCopyObject

Creates an exact copy of an object.

Deprecated
NSDeallocateObject

Destroys an existing object.

NSDecrementExtraRefCountWasZero

Decrements the specified object’s reference count.

NSExtraRefCount

Returns the specified object’s reference count.

NSIncrementExtraRefCount

Increments the specified object’s reference count.

NSShouldRetainWithZone

Indicates whether an object should be retained.

Debugging

NSCountFrames

Returns the number of call frames on the stack.

NSFrameAddress

Returns the value of the frame pointer of the specified frame.

NSIsFreedObject

Returns a Boolean indicating whether the specified object has been freed.

NSRecordAllocationEvent

Notes an object or zone allocation event and various other statistics, such as the time and current thread.

NSReturnAddress

Returns the value of the return address of the specified frame.