Instance Method

enableCollectorForPointer:

Specifies that a given pointer may be collected.

Declaration

- (void)enableCollectorForPointer:(const void *)ptr;

Parameters

ptr

A pointer to the memory that may be collected.

Discussion

You use this method to make memory that was previously marked as uncollectable. For example, given the address of the global dictionary created in disableCollectorForPointer:, you could make the dictionary collectable as follows:

[[NSGarbageCollector defaultCollector]
    enableCollectorForPointer:globalDictionary];

For more about root objects and scanned memory, see Garbage Collection Programming Guide.

See Also

Manipulating External References

disableCollectorForPointer:

Specifies that a given pointer will not be collected.

Deprecated