Contents

fetchChangesWithOptions:completionHandler:

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

Declaration

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

Parameters

  • options:

    The options to use when fetching changes. For more information, see Cksyncenginefetchchangesoptions.

  • completionHandler:

    The block to execute when the fetch completes.

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.

See Also

Invoking manual sync operations