TICDSSynchronizationOperation Class Reference
Inherits from | TICDSOperation : NSOperation |
Declared in | TICDSSynchronizationOperation.h |
Overview
The TICDSSynchronizationOperation
class describes a generic operation used by the TICoreDataSync
framework to synchronize changes made to a document.
In brief, a synchronization operation applies remote sync commands and changes locally, fixing any conflicts if necessary.
In full, the operation carries out the following tasks: (Sync Command tasks are included below, although not yet implemented)
- Go through each
SyncChangeSet
and:- Check for conflicts against local changes made since the last synchronization.
- Fix any conflicts, and build an array of conflict warnings for issues that cannot be resolved.
- Apply each
SyncChange
in the set to the localWholeStore
. - Add the UUID of the set to the list of
AppliedSyncChangeSets.ticdsync
.
Operations are typically created automatically by the relevant sync manager.
You need not use one of the subclasses of TICDSSynchronizationOperation
.
Tasks
Designated Initializer
-
– initWithDelegate:
Initialize a synchronization operation using a delegate that supports the
TICDSSynchronizationOperationDelegate
protocol. -
– configureBackgroundApplicationContextForPrimaryManagedObjectContext:
Configure a background context (for applying sync changes) using the same persistent store coordinator as the main application context.
Properties
-
synchronizationWarnings
The warnings generated during this synchronization.
property -
paused
A boolean indicating whether the operation is currently paused awaiting an instruction to continue, e.g. for conflict resolution.
property -
mostRecentConflictResolutionType
The resolution type for the most recent conflict, set before resuming the operation after a conflict is detected.
property
File Locations
-
localSyncChangesToMergeURL
The location of the
propertySyncChangesBeingSynchronized.syncchg
file for this synchronization operation. -
appliedSyncChangeSetsFileLocation
The location of this document’s
propertyAppliedSyncChangeSets.ticdsync
file. -
unappliedSyncChangesDirectoryLocation
The location of the
propertyUnappliedSyncChanges
directory for this synchronization operation. -
unappliedSyncChangeSetsFileLocation
The location of this document’s
propertyUnappliedSyncChangeSets.ticdsync
file. -
syncTransaction
The sync transaction to be used by this operation.
property -
syncTransactions
The sync transactions whose unsaved applied sync change files will be used as persistent stores to augment the applied sync changes managed object context.
property
Properties
appliedSyncChangeSetsFileLocation
The location of this document’s AppliedSyncChangeSets.ticdsync
file.
@property (strong) NSURL *appliedSyncChangeSetsFileLocation
Declared In
TICDSSynchronizationOperation.h
localSyncChangesToMergeURL
The location of the SyncChangesBeingSynchronized.syncchg
file for this synchronization operation.
@property (strong) NSURL *localSyncChangesToMergeURL
Declared In
TICDSSynchronizationOperation.h
mostRecentConflictResolutionType
The resolution type for the most recent conflict, set before resuming the operation after a conflict is detected.
@property (assign) TICDSSyncConflictResolutionType mostRecentConflictResolutionType
Declared In
TICDSSynchronizationOperation.h
paused
A boolean indicating whether the operation is currently paused awaiting an instruction to continue, e.g. for conflict resolution.
@property (assign, getter=isPaused) BOOL paused
Declared In
TICDSSynchronizationOperation.h
syncTransaction
The sync transaction to be used by this operation.
@property TICDSSyncTransaction *syncTransaction
Declared In
TICDSSynchronizationOperation.h
syncTransactions
The sync transactions whose unsaved applied sync change files will be used as persistent stores to augment the applied sync changes managed object context.
@property NSArray *syncTransactions
Declared In
TICDSSynchronizationOperation.h
synchronizationWarnings
The warnings generated during this synchronization.
@property (strong) NSMutableArray *synchronizationWarnings
Declared In
TICDSSynchronizationOperation.h
Instance Methods
configureBackgroundApplicationContextForPrimaryManagedObjectContext:
Configure a background context (for applying sync changes) using the same persistent store coordinator as the main application context.
- (void)configureBackgroundApplicationContextForPrimaryManagedObjectContext:(NSManagedObjectContext *)managedObjectContext
Parameters
- aPersistentStoreCoordinator
The persistent store coordinator to use for the background context.
Declared In
TICDSSynchronizationOperation.h
initWithDelegate:
Initialize a synchronization operation using a delegate that supports the TICDSSynchronizationOperationDelegate
protocol.
- (id)initWithDelegate:(NSObject<TICDSSynchronizationOperationDelegate> *)aDelegate
Parameters
- aDelegate
The delegate to use for this operation.
Return Value
An initialized synchronization operation.
Declared In
TICDSSynchronizationOperation.h