Inherits from | |
Conforms to | |
Framework | /System/Library/Frameworks/SyncServices.framework |
Availability | Available in Mac OS X v10.5 and later. |
Companion guide | |
Declared in | ISyncCoreData.h |
This category adds support for syncing Core Data applications—that is, syncing local changes made to managed objects to corresponding records managed by the sync engine—records that may be shared with other applications and synced to other computers over .Mac.
Use the syncWithClient:inBackground:handler:error:
method to start a sync either in the foreground or background. Optionally provide a sync handler that can intervene during the sync session. For example, verify changes before they are applied to local managed objects. The supplied sync handler must conform to the NSPersistentStoreCoordinatorSyncing
protocol.
Read Syncing Core Data Applications in Sync Services Programming Guide for more details on using Core Data sync.
Specifies where to save details about fast syncing for a persistent store.
- (void)setStoresFastSyncDetailsAtURL:(NSURL *)url forPersistentStore:(NSPersistentStore *)store
The location to store the information.
The persistent store that is syncing.
In order to fast sync, the persistent store coordinator needs to store information about what entities to push in the next sync. Use this method to specify where, in the file system, to store information about a sync per persistent store. This method must be invoked before any of the persistent stores are changed. If one of the persistent stores are changed before this method is invoked, the persistent store coordinator slow syncs on the next sync.
ISyncCoreData.h
Syncs managed objects, stored by the receiver, with the sync engine.
- (BOOL)syncWithClient:(ISyncClient *)client inBackground:(BOOL)flag handler:(id < NSPersistentStoreCoordinatorSyncing >)syncHandler error:(NSError **)rError
The client to sync.
YES
if syncing is non-blocking and occurs in a separate thread. NO
if syncing blocks and occurs in the senders thread—in which case, this method returns when syncing finishes or cancels.
Application supplied object that can optionally intervene during the sync session.
If the receiver fails to sync, an NSError
object describing the error.
NO
If the receiver is unable to create a sync session or an error occurs during the sync; otherwise, YES
.
Pass YES
for the inBackground:
parameter if you do not want this method to block—for example, if you are handling a sync alert and you registered the sync alert handler on the main thread.
ISyncCoreData.h
© 2007 Apple Inc. All Rights Reserved. (Last updated: 2007-07-11)