fetchChangesWithCompletionHandler:
Fetches pending remote changes from the server.
Declaration
- (void) fetchChangesWithCompletionHandler:(void (^)(NSError *error)) completionHandler;Parameters
- 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.