---
title: "enableCollectorForPointer:"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsgarbagecollector/enablecollectorforpointer:"
---

# enableCollectorForPointer:

Specifies that a given pointer may be collected.

## Declaration

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

## Parameters

- `ptr`: A pointer to the memory that may be collected.

## Discussion

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:](foundation/nsgarbagecollector/disablecollectorforpointer:.md)
