Instance Method


Returns a Boolean value that indicates whether garbage collection is currently enabled for the current process.


- (BOOL)isEnabled;

Return Value

YES if garbage collection is enabled for the current process, otherwise NO.


This method returns NO if garbage collection is on, but has been temporarily suspended (using disable).

To check whether the current process is using garbage collection check the result of [NSGarbageCollector defaultCollector]. If defaultCollector is nil, then garbage collection is permanently off. If defaultCollector is not nil, then the current process is using garbage collection—you can then use isEnabled to determine whether or not the collector is actually allowed to run right now.

See Also

Related Symbols

- enable

Enables collection after collection has been disabled.

- disable

Temporarily disables collections.