A class for managing autorelease pools. More...
#import <Foundation/Foundation.h>
Instance Methods | |
(void) | - addObject: |
Adds an object to the autorelease pool. More... | |
(void) | - drain |
Drain the autorelease pool. | |
![]() | |
(id) | - retain |
Increases the retain count of the receiver. More... | |
(void) | - release |
Decreases the retain count of the receiver. More... | |
(id) | - autorelease |
Adds the receiver to the autorelease pool. | |
![]() | |
(void) | - dealloc |
Free resources for an existing instance. | |
(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... | |
(NXString *) | - description |
Returns a string that represents the instance. More... | |
![]() | |
(BOOL) | - respondsToSelector: |
Checks if the receiver responds to a selector. More... | |
Class Methods | |
(id) | + currentPool |
The current autorelease pool. More... | |
![]() | |
(id) | + allocWithZone: |
Allocates a new instance of an object in a specific memory zone. More... | |
![]() | |
(void) | + initialize |
Performs one-time initialization for the class. More... | |
(id) | + alloc |
Allocate a new class instance. 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... | |
(NXString *) | + description |
Returns a string that represents the class. More... | |
Additional Inherited Members | |
![]() | |
id | _zone |
The memory zone where the object is allocated. | |
unsigned short | _retain |
The retain count of the object. | |
id | _next |
The next object in an autorelease pool. | |
![]() | |
Class | isa |
A pointer to the object's class structure. More... | |
A class for managing autorelease pools.
Autorelease pools provide a way to defer sending release
messages to objects. When an autorelease pool is drained, it sends a release
message to all objects that have been added to it. This is particularly useful in loops where many temporary objects are created.
Definition at line 22 of file NXAutoreleasePool.h.
- (void) addObject: | (id) | object |
Adds an object to the autorelease pool.
object | The object to be added to the pool. This object will be sent a release message when the pool is deallocated. |
+ (id) currentPool |
The current autorelease pool.
This variable holds the current autorelease pool that is being used. It is automatically set when an autorelease pool is created.