Michael Fey edited this page May 28, 2013 · 1 revision

How do I get TICoreDataSync to record changes even if I'm offline?

TICDS allows you to configure your sync managers without registering them. The framework will then record changes and write out sync change records. These records will then be synced the next time you're able to register an application sync manager with an internet connection. In MoneyWell we do it like so:

- (void)preconfigureDocumentSyncManager
    [self configureApplicationSyncManager];
    [self.documentSyncManager configureWithDelegate:self appSyncManager:[TICDSDropboxSDKBasedApplicationSyncManager defaultApplicationSyncManager] managedObjectContext:self.managedObjectContext documentIdentifier:[[NSUserDefaults standardUserDefaults] valueForKey:kTICDSDocumentIdentifier] description:[[NSUserDefaults standardUserDefaults] valueForKey:kTICDSDocumentDescription] userInfo:nil];

- (void)configureApplicationSyncManager
    TICDSDropboxSDKBasedApplicationSyncManager *applicationSyncManager = [TICDSDropboxSDKBasedApplicationSyncManager defaultApplicationSyncManager];
    NSString *clientUuid = [[NSUserDefaults standardUserDefaults] stringForKey:MWISyncClientUUIDKey];
    if (clientUuid == nil) {
        clientUuid = [TICDSUtilities uuidString];
        [[NSUserDefaults standardUserDefaults] setValue:clientUuid forKey:MWISyncClientUUIDKey];
    NSString *deviceDescription = [[UIDevice currentDevice] name];
    [applicationSyncManager configureWithDelegate:self globalAppIdentifier:MWIGlobalAppSyncIdentifier uniqueClientIdentifier:clientUuid description:deviceDescription userInfo:nil];

I'm having trouble using TICoreDataSync with CocoaPods

The No Thirst team isn't dogfooding the CocoaPods integration ourselves so there may be issues that we aren't aware of. If you run into trouble don't be afraid to open an issue for it and we'll ping Denis to see if he has any ideas, he's been graciously helping maintain the podspec file.

If you want to use CocoaPods with the tutorials here are some augmented steps that you can use:

  1. Make a copy of the Notebook sample. Create a file called Podfile in the root folder with the following contents:
platform :osx, "10.7"
pod 'TICoreDataSync'
  1. Run pod install. This will create an xcode workspace called Notebook.xcworkspace. Open that rather than the project file.

  2. Continue with the regular tutorial at the 'Managed Object Requirements' section.