Comments (4)
I ask because added objects before turning sync on will never be synched. Also, I found no way to deregister an already registered applicationSyncManager, so I can never turn sync off. Thank you
from ticoredatasync.
I could use a little more insight into your use case to understand exactly what you'd like to accomplish. If the user has configured syncing already, but wants to pause syncing for some reason, you can return NO
from the TICDSDocumentSyncManagerDelegate
documentSyncManager:shouldBeginSynchronizingAfterManagedObjectContextDidSave:
method. That's one way to "turn off" syncing.
If you'd like to make sure that all sync changes are properly recorded, even if the user has disabled syncing, you can configure a TICDSDocumentSyncManager
before you're ready to use it:
/** Configure a document but don't immediately register it.
Use this method to configure the sync manager in environments where you may not have a permanent internet connection, such as an iOS device, or a desktop WebDAV client, etc.
This will configure everything necessary to track changes made by the user. When you wish to initiate a sync, or perform any other task, you'll need to call the `registerConfiguredDocumentSyncManager` method first to initiate registration.
@warning You must call this method before using the document sync manager for any other purpose.
Do not use this method of registration the very first time the user configures registration on a document, or the internal checks to update the sync attribute on any pre-existing managed objects will not be made.
@param aDelegate The object you wish to be notified regarding document-related sync information; this object must conform to the `TICDSDocumentSyncManagerDelegate` protocol, which includes some required methods.
@param anAppSyncManager The application sync manager responsible for overseeing this document.
@param aContext The primary managed object context in your application; this must be an instance of `NSManagedObjectContext` and not just a plain `NSManagedObjectContext`.
@param aDocumentIdentifier An identification string to identify this document uniquely. You would typically create a UUID string the first time this doc is registered and store this in e.g. the store metadata.
@param aDocumentDescription A human-readable string used to identify this document, e.g. the full name of the document.
@param someUserInfo A dictionary of information that will be saved throughout all future synchronizations. Because this information is saved in a plist, everything in the dictionary must be archivable using `NSKeyedArchiver`.
*/
- (void)configureWithDelegate:(id <TICDSDocumentSyncManagerDelegate>)aDelegate appSyncManager:(TICDSApplicationSyncManager *)anAppSyncManager managedObjectContext:(NSManagedObjectContext *)aContext documentIdentifier:(NSString *)aDocumentIdentifier description:(NSString *)aDocumentDescription userInfo:(NSDictionary *)someUserInfo;
In MoneyWell when we need to reset our sync managers we use this method:
- (void)resetSyncManagers
{
[self.documentSyncManager deregisterDocumentSyncManager];
self.documentSyncManager = nil;
[TICDSApplicationSyncManager setDefaultApplicationSyncManager:nil];
[self.managedObjectContext setDocumentSyncManager:nil];
}
That should work for deregistering the TICDSApplicationSyncManager
.
from ticoredatasync.
Oh, do I have to configure only a TICDSDocumentSyncManager? I was configuring both TICDSApplicationSyncManager and TICDSDocumentSyncManager. This way it would never sync whatever changes I made before registering. I am going to test it out and update here. Thank you!
from ticoredatasync.
You will need a configured ApplicationSyncManager to configure the DocumentSyncManager, but once you configure that DSM it will capture all changes to your object graph that occur prior to the first sync.
from ticoredatasync.
Related Issues (20)
- TICDSLog() unsafe
- TICDSDropboxSDKBasedPreSynchronizationOperation's failedDownloadRetryDictionary uses different keys
- Synchronizing devices after a crash (or new devices). HOT 1
- Undoing added objects HOT 1
- Downloading the list of available documents in NSEventTrackingRunLoopMode HOT 2
- Integrating TICoreDataSync with Cocoapds
- New Device does not getting latest data since CoreData Model Update. HOT 1
- How to reset all Sync data to get a clean whole store upload? HOT 6
- Downloading current document's data after deleting local file HOT 5
- Avoid sync of some elements HOT 1
- Impossible to register new clients for existing database in Dropbox HOT 1
- Excessive memory usage when applying numerous change sets HOT 4
- Property attributes warnings HOT 7
- TICoreDataSync first run and sync loop HOT 6
- documentSyncManagerDidFinishSynchronizing executed 2 times HOT 6
- UploadWholeStore problem, empty db HOT 7
- Mac client and managedObjectContext changes not reflected to arrayController HOT 1
- (503) Rate limiting oauth_accesses_per_access_token HOT 1
- kTICDSClientDeviceIdentifier and ClientDevices directory
- iCloud branch behind a few commits
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ticoredatasync.