Inherits from NSObject
Conforms to TICDSDocumentRegistrationOperationDelegate
TICDSSynchronizationOperationDelegate
Declared in TICDSDocumentSyncManager.h

Overview

TICDSDocumentSyncManager describes the generic behavior provided by a Document Sync Manager in the TICoreDataSync framework.

A Document Sync Manager is responsible for synchronization settings relating to a single document–you’ll need one for each document you wish to synchronize. If your application is a non-document-based application, you’ll still need a single document sync manager to represent your application’s data.

Don’t instantiate this class directly, but instead use one of the subclasses:

  1. TICDSFileManagerBasedDocumentSyncManager
  2. TICDSDropboxSDKBasedDocumentSyncManager

%warning%
Warning: You must register the document sync manager before you can use it to synchronize the document, or perform any other tasks.

Tasks

Local Helper File Removal

Deregistration

One-Shot Document Registration

Delayed Document Registration

General Registration

Whole Store Upload and Download

  • – initiateUploadOfWholeStore

    Start the process manually to upload the entire store file for this document, along with the relevant AppliedSyncChanges.ticdsync file.

  • – initiateDownloadOfWholeStore

    Start the process to download the entire store file for this document, along with the relevant AppliedSyncChanges.ticdsync file.

Synchronization Process

Other Tasks Process

  • – cancelOtherTasks

    Cancel any operations in both the ApplicationSyncManager’s and DocumentSyncManager’s OtherTasks op queues

Background State Processing

Vacuuming Unneeded Files

Information on Registered Clients

Deleting Clients from a Document

Polling Remote Storage for Changes

Methods Overridden by Subclasses

Managed Object Context Saving

Properties

Operation Queues

Relative Paths

Properties

applicationSyncManager

The Application Sync Manager responsible for this document.

@property (nonatomic, strong) TICDSApplicationSyncManager *applicationSyncManager

Declared In

TICDSDocumentSyncManager.h

backgroundTaskID

Unique task identifier used when Sync Manager is performing a series of tasks that should be continued after app goes into background state

@property (nonatomic, assign) UIBackgroundTaskIdentifier backgroundTaskID

Declared In

TICDSDocumentSyncManager.h

clientIdentifier

The Client Identifier used for registration.

@property (nonatomic, readonly, copy) NSString *clientIdentifier

Declared In

TICDSDocumentSyncManager.h

configured

Used to indicate if the document sync manager has been configured via the configureWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo: method.

@property (nonatomic, getter=isConfigured) BOOL configured

Declared In

TICDSDocumentSyncManager.h

coreDataFactory

The TICoreDataFactory object used for SyncChange managed object contexts.

@property (nonatomic, strong) TICoreDataFactory *coreDataFactory

Declared In

TICDSDocumentSyncManager.h

delegate

The Document Sync Manager Delegate.

@property (nonatomic, weak) id<TICDSDocumentSyncManagerDelegate> delegate

Declared In

TICDSDocumentSyncManager.h

documentDescription

The Document Description used for registration.

@property (nonatomic, readonly, copy) NSString *documentDescription

Declared In

TICDSDocumentSyncManager.h

documentIdentifier

The Document Identifier used for registration.

@property (nonatomic, readonly, copy) NSString *documentIdentifier

Declared In

TICDSDocumentSyncManager.h

documentUserInfo

The User Info used for registration.

@property (nonatomic, readonly, strong) NSDictionary *documentUserInfo

Declared In

TICDSDocumentSyncManager.h

fileManager

An NSFileManager suitable for use in document registration tasks.

@property (nonatomic, readonly, strong) NSFileManager *fileManager

Declared In

TICDSDocumentSyncManager.h

helperFileDirectoryLocation

The location of a directory used by the TICoreDataSync framework to store local helper files for this document.

@property (readonly, strong) NSURL *helperFileDirectoryLocation

Discussion

You typically set this property by implementing the TICDSDocumentSyncManagerDelegate method documentSyncManager:helperFileDirectoryURLForDocumentWithIdentifier:description:userInfo:.

By default, the framework will use the location ~/Library/Application Support/ApplicationName/Documents/documentIdentifier.

Declared In

TICDSDocumentSyncManager.h

integrityKey

The integrity key used to check whether the synchronization data matches what’s expected.

@property (nonatomic, copy) NSString *integrityKey

Declared In

TICDSDocumentSyncManager.h

localAppliedSyncChangesFilePath

The path to the AppliedSyncChanges.ticdsync file, located in the helperFileDirectoryLocation.

@property (weak, nonatomic, readonly) NSString *localAppliedSyncChangesFilePath

Declared In

TICDSDocumentSyncManager.h

mustUploadStoreAfterRegistration

Used internally to indicate whether the document sync manager must upload the store after registration has completed.

@property (nonatomic, assign) BOOL mustUploadStoreAfterRegistration

Discussion

This will be YES if this is the first time this document has been registered.

Declared In

TICDSDocumentSyncManager.h

otherTasksQueue

The operation queue used for other tasks.

@property (nonatomic, readonly, strong) NSOperationQueue *otherTasksQueue

Discussion

The queue is suspended until the document has registered successfully.

Declared In

TICDSDocumentSyncManager.h

primaryDocumentMOC

The document managed object context that was supplied at registration, and therefore treated as the primary context.

@property (nonatomic, strong) NSManagedObjectContext *primaryDocumentMOC

Declared In

TICDSDocumentSyncManager.h

registrationQueue

The operation queue used for registration operations.

@property (nonatomic, readonly, strong) NSOperationQueue *registrationQueue

Declared In

TICDSDocumentSyncManager.h

relativePathToClientDevicesDirectory

The path to the ClientDevices directory, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToClientDevicesDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToDeletedDocumentsThisDocumentIdentifierPlistFile

The path to this document’s identifier.plist file inside the DeletedDocuments directory, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToDeletedDocumentsThisDocumentIdentifierPlistFile

Declared In

TICDSDocumentSyncManager.h

relativePathToDocumentsDirectory

The path to the Documents directory, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToDocumentsDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToInformationDeletedDocumentsDirectory

The path to the DeletedDocuments directory inside the Information directory, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToInformationDeletedDocumentsDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToInformationDirectory

The path to the Information directory, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToInformationDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentDeletedClientsDirectory

The path to this document’s DeletedClients directory, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentDeletedClientsDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentDirectory

The path to this document’s directory inside the Documents directory, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentRecentSyncsDirectory

The path to this document’s RecentSyncs directory, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentRecentSyncsDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentRecentSyncsDirectoryThisClientFile

The path this client’s RecentSync file inside this document’s RecentSyncs directory, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentRecentSyncsDirectoryThisClientFile

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentSyncChangesDirectory

The path to the SyncChanges directory for this document, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentSyncChangesDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentSyncChangesThisClientDirectory

The path to this client’s directory inside the SyncChanges directory for this document, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentSyncChangesThisClientDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentSyncCommandsDirectory

The path to the SyncCommands directory for this document, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentSyncCommandsDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentSyncCommandsThisClientDirectory

The path to this client’s directory inside the SyncCommands directory for this document, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentSyncCommandsThisClientDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentTemporaryFilesDirectory

The path to the TemporaryFiles directory for this document, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentTemporaryFilesDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentTemporaryWholeStoreDirectory

The path to the WholeStore directory inside the TemporaryFiles directory for this document, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentTemporaryWholeStoreDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentTemporaryWholeStoreThisClientDirectory

The path to this client’s directory inside the WholeStore directory inside the TemporaryFiles directory for this document, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentTemporaryWholeStoreThisClientDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentTemporaryWholeStoreThisClientDirectoryAppliedSyncChangeSetsFile

The path to this client’s AppliedSyncChangeSets.ticdsync file inside it’s directory inside the WholeStore directory inside the TemporaryFiles directory for this document, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentTemporaryWholeStoreThisClientDirectoryAppliedSyncChangeSetsFile

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentTemporaryWholeStoreThisClientDirectoryWholeStoreFile

The path to this client’s WholeStore.ticdsync file inside it’s directory inside the WholeStore directory inside the TemporaryFiles directory for this document, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentTemporaryWholeStoreThisClientDirectoryWholeStoreFile

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentWholeStoreDirectory

The path to the WholeStore directory for this document, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentWholeStoreDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentWholeStoreThisClientDirectory

The path to this client’s directory inside the WholeStore directory for this document, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentWholeStoreThisClientDirectory

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentWholeStoreThisClientDirectoryAppliedSyncChangeSetsFile

The path to this client’s AppliedSyncChangeSets.ticdsync file inside it’s directory inside the WholeStore directory for this document, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentWholeStoreThisClientDirectoryAppliedSyncChangeSetsFile

Declared In

TICDSDocumentSyncManager.h

relativePathToThisDocumentWholeStoreThisClientDirectoryWholeStoreFile

The path to this client’s WholeStore.ticdsync file inside it’s directory inside the WholeStore directory for this document, relative to the root of the remote file structure.

@property (weak, nonatomic, readonly) NSString *relativePathToThisDocumentWholeStoreThisClientDirectoryWholeStoreFile

Declared In

TICDSDocumentSyncManager.h

shouldContinueProcessingInBackgroundState

Indicates whether the document sync manager should be setup to continue processing after the app has been moved from the Active to Background state

@property (nonatomic, assign) BOOL shouldContinueProcessingInBackgroundState

Declared In

TICDSDocumentSyncManager.h

shouldUseCompressionForWholeStoreMoves

Used to indicate whether the document sync manager should use compression when moving whole store.

@property (nonatomic, assign) BOOL shouldUseCompressionForWholeStoreMoves

Discussion

This value is set automatically by the application sync manager.

Declared In

TICDSDocumentSyncManager.h

shouldUseEncryption

Used to indicate whether the document sync manager should use encryption for the remote files.

@property (nonatomic, assign) BOOL shouldUseEncryption

Discussion

This value is set automatically by the application sync manager.

Declared In

TICDSDocumentSyncManager.h

state

Document Sync Manager State.

@property (nonatomic, assign) TICDSDocumentSyncManagerState state

Discussion

The state of the document sync manager indicates whether it is ready to synchronize.

Possible values are defined in TICDSTypesAndEnums.h.

Declared In

TICDSDocumentSyncManager.h

syncChangesBeingSynchronizedStorePath

The path to the SyncChangesBeingSynchronized.syncchg file, located in the helperFileDirectoryLocation.

@property (weak, nonatomic, readonly) NSString *syncChangesBeingSynchronizedStorePath

Declared In

TICDSDocumentSyncManager.h

syncChangesMOCs

A dictionary containing the SyncChanges managed object contexts to use for each document managed object context.

@property (strong) NSMutableDictionary *syncChangesMOCs

Declared In

TICDSDocumentSyncManager.h

synchronizationQueue

The operation queue used for synchronization operations.

@property (nonatomic, readonly, strong) NSOperationQueue *synchronizationQueue

Discussion

The queue supports only 1 operation at a time, and is suspended until the document has registered successfully.

Declared In

TICDSDocumentSyncManager.h

unsynchronizedSyncChangesStorePath

The path to the UnsynchronizedSyncChanges.syncchg file, located in the helperFileDirectoryLocation.

@property (weak, nonatomic, readonly) NSString *unsynchronizedSyncChangesStorePath

Declared In

TICDSDocumentSyncManager.h

Instance Methods

addManagedObjectContext:

Add an additional background managed object context to this document sync manager.

- (void)addManagedObjectContext:(NSManagedObjectContext *)aContext

Parameters

aContext

The additional managed object context to add.

Discussion

Use this method to add an additional managed object context in which changes should be tracked, for example a context used to add items in the background.

Declared In

TICDSDocumentSyncManager.h

beginPollingRemoteStorageForChanges

Begin polling the remote storage for changes to the sync directory.

- (void)beginPollingRemoteStorageForChanges

Discussion

This method will cause the document sync manager to periodically poll the remote storage for changes to the sync directory and will kick off a sync if changes are found.

Declared In

TICDSDocumentSyncManager.h

cancelNonBackgroundStateOperations

Initiate cancellation of tasks that are not marked as being supported in background state

- (void)cancelNonBackgroundStateOperations

Declared In

TICDSDocumentSyncManager.h

cancelOtherTasks

Cancel any operations in both the ApplicationSyncManager’s and DocumentSyncManager’s OtherTasks op queues

- (void)cancelOtherTasks

Declared In

TICDSDocumentSyncManager.h

cancelSynchronization

Cancel synchronizing the document with the remote location.

- (void)cancelSynchronization

Discussion

This will cancel all synchronization operations and notify you of progress through the TICDSDocumentSyncManagerDelegate methods.

Declared In

TICDSDocumentSyncManager.h

configureWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo:

Configure a document but don’t immediately register it.

- (void)configureWithDelegate:(id<TICDSDocumentSyncManagerDelegate>)aDelegate appSyncManager:(TICDSApplicationSyncManager *)anAppSyncManager managedObjectContext:(NSManagedObjectContext *)aContext documentIdentifier:(NSString *)aDocumentIdentifier description:(NSString *)aDocumentDescription userInfo:(NSDictionary *)someUserInfo

Parameters

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.

anAppSyncManager

The application sync manager responsible for overseeing this document.

aContext

The primary managed object context in your application; this must be an instance of NSManagedObjectContext and not just a plain NSManagedObjectContext.

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.

aDocumentDescription

A human-readable string used to identify this document, e.g. the full name of the document.

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.

Discussion

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%
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.

Declared In

TICDSDocumentSyncManager.h

continueRegistrationByCreatingRemoteFileStructure:

Continue Registration.

- (void)continueRegistrationByCreatingRemoteFileStructure:(BOOL)shouldCreateFileStructure

Parameters

shouldCreateFileStructure

YES if the registration should continue and create the necessary remote file structure, or NO to cancel the registration.

Discussion

If this is the first time you have registered this document, or the remote file structure has been removed for some reason, your delegate will be notified with the documentSyncManager:didPauseRegistrationAsRemoteFileStructureDoesNotExistForDocumentWithIdentifier:description:userInfo: method. You must continue registration manually by calling this method, specifying whether or not the registration should continue by creating the remote file structure.

If you specify NO, registration will fail with an error.

Declared In

TICDSDocumentSyncManager.h

continueSynchronizationByResolvingConflictWithResolutionType:

If a conflict is encountered during synchronization, your delegate will be notified with the solveConflict: method. You must decide whether the remote or local SyncChange wins, and inform the document sync manager using this method to continue synchronization.

- (void)continueSynchronizationByResolvingConflictWithResolutionType:(TICDSSyncConflictResolutionType)aType

Parameters

aType

The type of conflict resolution; see TICDSTypesAndEnums.h for possible values.

Declared In

TICDSDocumentSyncManager.h

deleteDocumentSynchronizationDataForClientWithIdentifier:

Delete the files used by a client to synchronize with this document.

- (void)deleteDocumentSynchronizationDataForClientWithIdentifier:(NSString *)anIdentifier

Parameters

anIdentifier

The unique synchronization identifier of the client to delete.

Discussion

This will automatically spawn a TICDSDocumentClientDeletionOperation, and notify you of progress through the TICDSDocumentSyncManagerDelegate methods.

Declared In

TICDSDocumentSyncManager.h

deregisterDocumentSyncManager

Puts this document sync manager in a deregistered state.

- (void)deregisterDocumentSyncManager

Declared In

TICDSDocumentSyncManager.h

documentClientDeletionOperation

Returns a “deletion of client synchronization data from a document” operation.

- (TICDSDocumentClientDeletionOperation *)documentClientDeletionOperation

Return Value

A correctlyconfigured subclass of TICDSDocumentClientDeletionOperation.

Discussion

Subclasses of TICDSDocumentSyncManager use this method to return a correctlyconfigured operation for their particularly sync method.

Declared In

TICDSDocumentSyncManager.h

documentRegistrationOperation

Returns a document registration operation.

- (TICDSDocumentRegistrationOperation *)documentRegistrationOperation

Return Value

A correctlyconfigured subclass of TICDSDocumentRegistrationOperation.

Discussion

Subclasses of TICDSDocumentSyncManager use this method to return a correctlyconfigured document registration operation for their particular sync method.

Declared In

TICDSDocumentSyncManager.h

initiateDownloadOfWholeStore

Start the process to download the entire store file for this document, along with the relevant AppliedSyncChanges.ticdsync file.

- (void)initiateDownloadOfWholeStore

Discussion

This will automatically spawn a TICDSWholeStoreDownloadOperation, and notify you of progress through the TICDSDocumentSyncManagerDelegate methods.

The location of the store file (and the applied sync changes file) will be requested from the delegate immediately after calling this method.

Declared In

TICDSDocumentSyncManager.h

initiateSynchronization

Start synchronizing the document with the remote location.

- (void)initiateSynchronization

Discussion

This will automatically spawn a TICDSSynchronizationOperation, and notify you of progress through the TICDSDocumentSyncManagerDelegate methods.

Declared In

TICDSDocumentSyncManager.h

initiateUploadOfWholeStore

Start the process manually to upload the entire store file for this document, along with the relevant AppliedSyncChanges.ticdsync file.

- (void)initiateUploadOfWholeStore

Discussion

This will automatically spawn a TICDSWholeStoreUploadOperation, and notify you of progress through the TICDSDocumentSyncManagerDelegate methods.

The location of the store file (and the applied sync changes file) will be requested from the delegate immediately after calling this method.

Declared In

TICDSDocumentSyncManager.h

initiateVacuumOfUnneededRemoteFiles

Initiate a vacuum operation to clean up files hanging around on the remote that are no longer needed by any registered clients.

- (void)initiateVacuumOfUnneededRemoteFiles

Discussion

This will automatically spawn a TICDSVacuumOperation, and notify you of progress through the TICDSDocumentSyncManagerDelegate methods.

Declared In

TICDSDocumentSyncManager.h

listOfDocumentRegisteredClientsOperation

Returns a “list of registered clients for this document” operation.

- (TICDSListOfDocumentRegisteredClientsOperation *)listOfDocumentRegisteredClientsOperation

Return Value

A correctlyconfigured subclass of TICDSListOfDocumentRegisteredClientsOperation.

Discussion

Subclasses of TICDSDocumentSyncManager use this method to return a correctlyconfigured operation for their particularly sync method.

Declared In

TICDSDocumentSyncManager.h

preConfigureWithDelegate:appSyncManager:documentIdentifier:

Pre-configure a sync manager for a document that’s just been downloaded, but without carrying out full registration.

- (void)preConfigureWithDelegate:(id<TICDSDocumentSyncManagerDelegate>)aDelegate appSyncManager:(TICDSApplicationSyncManager *)anAppSyncManager documentIdentifier:(NSString *)aDocumentIdentifier

Parameters

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.

anAppSyncManager

The application sync manager responsible for overseeing this document.

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.

Discussion

Use this method to provide basic configuration of the sync manager for a document that’s been downloaded by calling the TICDSApplicationSyncManager method requestDownloadOfDocumentWithIdentifier:toLocation:, normally in response to the TICDSApplicationSyncManager delegate method applicationSyncManager:preConfiguredDocumentSyncManagerForDownloadedDocumentWithIdentifier:atURL:.

This will setup the necessary helper file location and do any local configuration, but won’t register the document with the remote.

If an error occurs, the delegate will be informed via the applicationSyncManager:didFailToRegisterWithError: method.

%warning%
Warning: This method is called automatically by registerWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo:, so you should only call it when needed during the document download process, not during general document registration.

Declared In

TICDSDocumentSyncManager.h

registerConfiguredDocumentSyncManager

Register a document that has already been preconfigured.

- (void)registerConfiguredDocumentSyncManager

Discussion

Use this method to register a document sync manager that you have already configured using the configureWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo: method.

Declared In

TICDSDocumentSyncManager.h

registerWithDelegate:appSyncManager:managedObjectContext:documentIdentifier:description:userInfo:

Register a document ready for synchronization.

- (void)registerWithDelegate:(id<TICDSDocumentSyncManagerDelegate>)aDelegate appSyncManager:(TICDSApplicationSyncManager *)anAppSyncManager managedObjectContext:(NSManagedObjectContext *)aContext documentIdentifier:(NSString *)aDocumentIdentifier description:(NSString *)aDocumentDescription userInfo:(NSDictionary *)someUserInfo

Parameters

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.

anAppSyncManager

The application sync manager responsible for overseeing this document.

aContext

The primary managed object context in your application; this must be an instance of NSManagedObjectContext whose synchronized property is set to YES.

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.

aDocumentDescription

A human-readable string used to identify this document, e.g. the full name of the document.

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.

Discussion

Use this method to register the sync manager ready for document synchronization.

This will automatically spawn a TICDSDocumentRegistrationOperation, and notify you of progress through the TICDSDocumentSyncManagerDelegate methods.

If this is the first time you have registered the document with this identifier, registration will automatically create the file structure necessary at the remote end for this and other clients to synchronize. See [TICDSUtilities remoteDocumentFileStructure] for the structure that will be created.

If you provide an application sync manager that isn’t yet ready to sync, the document registration task will be suspended until the application has finished registering.

If this is the first time you have registered this document, or the remote file structure has been removed for some reason, your delegate will be notified with the documentSyncManager:didPauseRegistrationAsRemoteFileStructureDoesNotExistForDocumentWithIdentifier:description:userInfo: method. You must continue registration manually by calling the continueRegistrationByCreatingRemoteFileStructure: method.

%warning%
Warning: You must call this method before using the document sync manager for any other purpose.

Declared In

TICDSDocumentSyncManager.h

removeLocalHelperFiles:

Remove Local Helper Files.

- (void)removeLocalHelperFiles:(NSError **)error

Parameters

error

If the file manager fails to remove the files the error will be non-nil.

Discussion

Use this method to teardown the local sync helper files that TICDS stores. This method does not require a configured and registered document sync manager unless you’ve specified a custom location for TICDS to store the helper files.

Declared In

TICDSDocumentSyncManager.h

requestInformationForAllRegisteredDevices

Fetch a list of devices that are registered to synchronize with this client.

- (void)requestInformationForAllRegisteredDevices

Declared In

TICDSDocumentSyncManager.h

stopPollingRemoteStorageForChanges

Stop polling the remote storage for changes to the sync directory.

- (void)stopPollingRemoteStorageForChanges

Discussion

This method will cause the document sync manager to stop polling the remote storage for changes to the sync directory.

Declared In

TICDSDocumentSyncManager.h

syncChangesMocForDocumentMoc:

Returns a SyncChanges managed object context for a given document managed object context.

- (NSManagedObjectContext *)syncChangesMocForDocumentMoc:(NSManagedObjectContext *)aContext

Declared In

TICDSDocumentSyncManager.h

synchronizationOperation

Returns a synchronization operation.

- (TICDSSynchronizationOperation *)synchronizationOperation

Return Value

A correctlyconfigured subclass of TICDSSynchronizationOperation.

Discussion

Subclasses of TICDSDocumentSyncManager use this method to return a correctlyconfigured synchronization operation for their particular sync method.

Declared In

TICDSDocumentSyncManager.h

synchronizedMOCWillSave:

Indicate that the synchronized managed object context is about to save.

- (void)synchronizedMOCWillSave:(NSManagedObjectContext *)aMoc

Parameters

aMoc

The synchronized managed object context.

Discussion

This method is called automatically by NSManagedObjectContext when it’s about to initiate a save:.

Declared In

TICDSDocumentSyncManager.h

vacuumOperation

Returns a vacuum operation.

- (TICDSVacuumOperation *)vacuumOperation

Return Value

A correctlyconfigured subclass of TICDSVacuumOperation.

Discussion

Subclasses of TICDSDocumentSyncManager use this method to return a correctlyconfigured vacuum operation for their particular sync method.

Declared In

TICDSDocumentSyncManager.h

wholeStoreDownloadOperation

Returns a whole store download operation.

- (TICDSWholeStoreDownloadOperation *)wholeStoreDownloadOperation

Return Value

A correctlyconfigured subclass of TICDSWholeStoreDownloadOperation.

Discussion

Subclasses of TICDSDocumentSyncManager use this method to return a correctlyconfigured whole store download operation (including the remote location of the document’s whole store, etc) for their particular sync method.

Declared In

TICDSDocumentSyncManager.h

wholeStoreUploadOperation

Returns a whole store upload operation.

- (TICDSWholeStoreUploadOperation *)wholeStoreUploadOperation

Return Value

A correctlyconfigured subclass of TICDSWholeStoreUploadOperation.

Discussion

Subclasses of TICDSDocumentSyncManager use this method to return a correctlyconfigured whole store upload operation for their particular sync method.

Declared In

TICDSDocumentSyncManager.h