FROM : Ben Trumbull
DATE : Tue May 13 21:40:05 2008
At 10:44 AM -0700 5/12/08, <email_removed> wrote:
>Hello,
>I'm using core-data in a program of mine. It uses two context where
>one of these is used in a second thread to perform saving operation.
>Sometimes at the end of all operations when I perform a save operation
>on my main context I receive a
>"conflictList" error.
>Is there any way to avoid it by merging changes?
>I've tried with
>[[self managedObjectContext] processPendingChanges];
>[[self managedObjectContext] commitEditing];
-commitEditing is for controllers bound to this
NSManagedObjectContext. It doesn't do anything from Core Data's
perspective, it just passes the message along.
You should check out the merge policies in the Core Data Reference
Guide, and the Core Data Programming Guide. The default policy is
"error out" so you actually have to think about what you want done.
<http://developer.apple.com/documentation/Cocoa/Reference/CoreDataFramework/Classes/NSManagedObjectContext_Class/Reference/Reference.html#//apple_ref/doc/constant_group/Merge_Policies>
--
-Ben
DATE : Tue May 13 21:40:05 2008
At 10:44 AM -0700 5/12/08, <email_removed> wrote:
>Hello,
>I'm using core-data in a program of mine. It uses two context where
>one of these is used in a second thread to perform saving operation.
>Sometimes at the end of all operations when I perform a save operation
>on my main context I receive a
>"conflictList" error.
>Is there any way to avoid it by merging changes?
>I've tried with
>[[self managedObjectContext] processPendingChanges];
>[[self managedObjectContext] commitEditing];
-commitEditing is for controllers bound to this
NSManagedObjectContext. It doesn't do anything from Core Data's
perspective, it just passes the message along.
You should check out the merge policies in the Core Data Reference
Guide, and the Core Data Programming Guide. The default policy is
"error out" so you actually have to think about what you want done.
<http://developer.apple.com/documentation/Cocoa/Reference/CoreDataFramework/Classes/NSManagedObjectContext_Class/Reference/Reference.html#//apple_ref/doc/constant_group/Merge_Policies>
--
-Ben
| Related mails | Author | Date |
|---|---|---|
| Dex Morgan | May 12, 19:18 | |
| Ben Trumbull | May 13, 21:40 |






Cocoa mail archive

