---
title: "synchronizeToBackingStore(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextelementprovider/synchronizetobackingstore(_:)"
---

# synchronizeToBackingStore(_:)

Synchronizes changes to the backing store.

## Declaration

```swift
func synchronizeToBackingStore(_ completionHandler: (@Sendable ((any Error)?) -> Void)? = nil)
```

```swift
func synchronizeToBackingStore() async throws
```

## Parameters

- `completionHandler`: A completion handler to run upon successful completion, or to process an error upon failure.

## Discussion

Discussion If completionHandler is nil, performs the operation synchronously. The completionHandler gets passed error if the synchronization fails. It should block (or fails if synchronous) when there’s an active transaction.
