<!--
{
  "availability" : [
    "macCatalyst: -",
    "macOS: 10.5.0 - 10.10.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSGarbageCollector/isEnabled",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSGarbageCollector(im)isEnabled"
  },
  "title" : "isEnabled"
}
-->

# isEnabled

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

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

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if garbage collection is enabled for the current process, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

This method returns <doc://com.apple.documentation/documentation/Swift/false> if garbage collection is on, but has been temporarily suspended (using [`disable`](/documentation/Foundation/NSGarbageCollector/disable)).

To check whether the current process is using garbage collection check the result of `[NSGarbageCollector defaultCollector]`. If [`defaultCollector`](/documentation/Foundation/NSGarbageCollector/defaultCollector) is `nil`, then garbage collection is permanently off. If [`defaultCollector`](/documentation/Foundation/NSGarbageCollector/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)