<!--
{
  "availability" : [
    "iOS: 15.0.0 -",
    "iPadOS: 15.0.0 -",
    "macCatalyst: -",
    "macOS: 12.0.0 -",
    "tvOS: 15.0.0 -",
    "visionOS: -",
    "watchOS: 8.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreData",
  "identifier" : "/documentation/CoreData/NSPersistentStoreCoordinator/performAndWait(_:)-15ude",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Core Data",
      "CoreData"
    ],
    "preciseIdentifier" : "s:So28NSPersistentStoreCoordinatorC8CoreDataE14performAndWaityxxyKXEKlF"
  },
  "title" : "performAndWait(_:)"
}
-->

# performAndWait(_:)

Executes the provided closure on the coordinator’s queue and waits for it to finish.

```
@preconcurrency func performAndWait<T>(_ block: @Sendable () throws -> T) rethrows -> T
```

## Parameters

`block`

The closure to execute.

---

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)