Determining when a Lion Versioned document is locked/unlocked
Determining when a Lion Versioned document is locked/unlocked
- Subject: Determining when a Lion Versioned document is locked/unlocked
- From: Dave Fernandes <email@hidden>
- Date: Wed, 16 Nov 2011 13:31:33 -0500
SUMMARY
I'd like to know when a document is in the "locked" state. Cocoa provides -[NSDocument checkAutosavingSafetyAndReturnError:]; but this only seems to tell me when the heuristics think the document should be locked, not when the user has deliberately locked the document. Is there any way to determine the actual locked state, or receive a notification when it changes?
PROBLEM
I have a document-bases app where documents conceptually contain widgets and other data. The widget properties are managed from an application (singleton) library. Normally, the user would expect the widgets to always be in sync with this library. However, when the document is locked or emailed to someone else (who may have a quite different widget library), the document should retain the widget properties as they existed in the library when the document was locked.
This means the document must contain a copy of any widgets it uses. It also means that either the app must automatically "sync" the document's widgets with the library at appropriate times, or the user must do this her/himself. Since, the user almost always wants the two to be in sync, I would much rather the application do this automatically. Thus, the app needs to know when this is appropriate, and so, needs to know the locked state.
But if you can think of a better application design, I'd be happy to hear it.
Dave_______________________________________________
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