• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core Data & NSPersistentDocument & Concurrency
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data & NSPersistentDocument & Concurrency


  • Subject: Re: Core Data & NSPersistentDocument & Concurrency
  • From: Eric Gorr <email@hidden>
  • Date: Sat, 02 Feb 2013 19:59:23 -0500

On Feb 1, 2013, at 7:00 PM, Mike Abdullah <email@hidden> wrote:

>
> On 1 Feb 2013, at 22:11, Felix Franz <email@hidden> wrote:
>
>>
>> On 01.02.2013, at 21:13, email@hidden wrote:
>>
>>>
>>> The problem then is that my NSPersistentDocument generates an error which says:
>>>
>>>   "The document "xxx" could not be saved. The file has been changed by another application"
>>>
>>> Of course, the other application is the NSOperation which did change the document.
>>>
>>> How can I correctly avoid the error?
>>
>> Never tried it, but maybe the workaround documented in NSManagedObjectContext>obtainPermanentIDsForObjects:error:
>> works here too (calling setFileModificationDate on the document).
>>
>> https://developer.apple.com/library/mac/documentation/Cocoa/Reference/CoreDataFramework/Classes/NSManagedObjectContext_Class/NSManagedObjectContext.html#//apple_ref/doc/uid/TP30001182-SW7
>
> Ideally, avoid doing this. It is effectively just papering over the problem.

It does appear this works. I tried it out by updating the file modification date after I received the NSManagedObjectContextDidSaveNotification, but the problem persisted.



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Core Data & NSPersistentDocument & Concurrency (From: email@hidden)
 >Re: Core Data & NSPersistentDocument & Concurrency (From: Felix Franz <email@hidden>)
 >Re: Core Data & NSPersistentDocument & Concurrency (From: Mike Abdullah <email@hidden>)

  • Prev by Date: Re: Annoying dialog
  • Next by Date: Re: Core Data & NSPersistentDocument & Concurrency
  • Previous by thread: Re: Core Data & NSPersistentDocument & Concurrency
  • Next by thread: Re: Core Data & NSPersistentDocument & Concurrency
  • Index(es):
    • Date
    • Thread