<!--
{
  "availability" : [
    "iOS: 1.0.0 -",
    "iPadOS: 1.0.0 -",
    "macCatalyst: -",
    "macOS: 10.0.0 -",
    "tvOS: 1.0.0 -",
    "visionOS: -",
    "watchOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "ObjectiveC",
  "identifier" : "/documentation/ObjectiveC/autoreleasepool(invoking:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Objective-C Runtime"
    ],
    "preciseIdentifier" : "s:10ObjectiveC15autoreleasepool8invokingq_q_yxYKXE_txYKs5ErrorRzRi__r0_lF"
  },
  "title" : "autoreleasepool(invoking:)"
}
-->

# autoreleasepool(invoking:)

```
func autoreleasepool<E, Result>(invoking body: () throws(E) -> Result) throws(E) -> Result where E : Error, Result : ~Copyable
```

---

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)