---
title: "fetchChangesWithOptions:completionHandler:"
framework: cloudkit
role: symbol
role_heading: Instance Method
path: "cloudkit/cksyncengine-4b4w9/fetchchangeswithoptions:completionhandler:"
---

# fetchChangesWithOptions:completionHandler:

Fetches pending remote changes from the server using the specified options.

## Declaration

```occ
- (void) fetchChangesWithOptions:(CKSyncEngineFetchChangesOptions *) options completionHandler:(void (^)(NSError *error)) completionHandler;
```

## Parameters

- `options`: The options to use when fetching changes. For more information, see doc://com.apple.cloudkit/documentation/CloudKit/CKSyncEngineFetchChangesOptions.
- `completionHandler`: The block to execute when the fetch completes.

## Discussion

Discussion If the fetch fails, the completion handler’s error parameter is an object that describes that failure; otherwise, it’s nil. Use this method to request the sync engine immediately fetches all pending remote changes before your app continues. This isn’t necessary in normal use, as the engine automatically syncs your app’s records. It is useful, however, in scenarios where you require more control over sync, such as pull-to-refresh or unit tests. note: The sync engine invokes the completion handler only after your sync delegate finishes processing all related fetch events.

## See Also

### Invoking manual sync operations

- [fetchChangesWithCompletionHandler:](cloudkit/cksyncengine-4b4w9/fetchchangeswithcompletionhandler:.md)
- [CKSyncEngineFetchChangesOptions](cloudkit/cksyncenginefetchchangesoptions.md)
- [sendChangesWithCompletionHandler:](cloudkit/cksyncengine-4b4w9/sendchangeswithcompletionhandler:.md)
- [sendChangesWithOptions:completionHandler:](cloudkit/cksyncengine-4b4w9/sendchangeswithoptions:completionhandler:.md)
- [CKSyncEngineSendChangesOptions](cloudkit/cksyncenginesendchangesoptions.md)
