views:

27

answers:

1

Apple says about -detectConflictsForObject:

If on the next invocation of save: object has been modified in its persistent store, the save fails. This allows optimistic locking for unchanged objects. Conflict detection is always performed on changed or deleted objects.

So what does this mean? If I simply modify an managed object and then save the context, there is always a conflict detection happening? Does this conflict detection simply compare the timestamps of the "records" to see if the "new" data is actually "old"? Is that a conflict?

A: 

No that is not a conflict. A conflict occurs if the data has changed on disk since the last time the object in memory was refreshed. The internal implementation is not defined and a implementation detail.

The only thing we need to be concerned about is that it will only occur when the data on disk has changed outside of the context that is being saved.

Marcus S. Zarra