Enable Automatic Synchronization After Changes are Detected:
You’ll need to turn on remote change polling immediately after the document sync manager has finished registering, so add the following into the relevant delegate method:
If the whole stores need to be downloaded this causes the sync changes to be downloaded and "applied" before the whole store is downloaded - causing some of those changes not be applied. I was mainly seeing the problem for deletions. It could also be due to how I have application structured. My own documentSyncManagerDidFinishRegistering: method is as follows:
(this is after I changed it so that it works correctly for me)
NSUserDefaults * ud = [NSUserDefaults standardUserDefaults];
[ud setBool:YES forKey:OPTIONS_SYNC_WITH_DROPBOX_ON];
}
If a download of the whole stores is necessary I put [self.documentSyncManager beginPollingRemoteStorageForChanges] in documentSyncManagerDidFinishDownloadingWholeStore:.
In the iOS Tutorial it says:
Enable Automatic Synchronization After Changes are Detected:
You’ll need to turn on remote change polling immediately after the document sync manager has finished registering, so add the following into the relevant delegate method:
If the whole stores need to be downloaded this causes the sync changes to be downloaded and "applied" before the whole store is downloaded - causing some of those changes not be applied. I was mainly seeing the problem for deletions. It could also be due to how I have application structured. My own documentSyncManagerDidFinishRegistering: method is as follows:
(this is after I changed it so that it works correctly for me)
(void)documentSyncManagerDidFinishRegistering:(TICDSDocumentSyncManager *)aSyncManager {
if (self.shouldDownloadStoreAfterRegistering) { [aSyncManager initiateDownloadOfWholeStore]; } else { [aSyncManager initiateSynchronization];
}
self.documentSyncManagerReady = YES;
NSUserDefaults * ud = [NSUserDefaults standardUserDefaults]; [ud setBool:YES forKey:OPTIONS_SYNC_WITH_DROPBOX_ON];
}
If a download of the whole stores is necessary I put [self.documentSyncManager beginPollingRemoteStorageForChanges] in documentSyncManagerDidFinishDownloadingWholeStore:.
Thanks! Mazen