Turn off saveDocumentWithDelegate:didSaveSelector:contextInfo: check for modified file in 10.5?
Turn off saveDocumentWithDelegate:didSaveSelector:contextInfo: check for modified file in 10.5?
- Subject: Turn off saveDocumentWithDelegate:didSaveSelector:contextInfo: check for modified file in 10.5?
- From: "Barry Wark" <email@hidden>
- Date: Mon, 19 May 2008 12:34:14 -0700
I think I remember seeing a discussion of this issue before, but can't
seem to find it in the archives/Google. Pointers greatly
appreciated...
I'm working on a NSPersistentDocument-based CoreData app that was
developed on 10.4. We've since moved to the 10.5.sdk. The document in
this app spawns a worker thread that builds a new Managed Object
Context using the document's persistent store coordinator. The worker
thread adds several instances of NSMagagedObjects to this MOC and then
calls save: to save those objects to the persistent store and then
resets the MOC before repeating. Starting in 10.5, the document shows
a warning when the user tries to save the document ("This document's
file has been changed by another application since you opened or saved
it"), as described in the documentation for
saveDocumentWithDelegate:didSaveSelector:contextInfo:. In this case,
the warning is due to the file modification caused by saving the MOC
in the worker thread. Since the worker thread has only added instances
to the persistent store, I believe it is OK for the document to save
it's MOC (and testing backs up this belief). Can I prevent this
warning from being presented to the user in 10.5?
thanks,
Barry
_______________________________________________
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