---
title: isEnabled
framework: foundation
role: symbol
role_heading: Instance Method
path: foundation/nsgarbagecollector/isenabled
---

# isEnabled

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

## Declaration

```occ
- (BOOL) isEnabled;
```

## Return Value

Return Value true if garbage collection is enabled for the current process, otherwise false.

## Discussion

Discussion This method returns false 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

### Collection State

- [disable](foundation/nsgarbagecollector/disable.md)
- [enable](foundation/nsgarbagecollector/enable.md)
- [isCollecting](foundation/nsgarbagecollector/iscollecting.md)
