• 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
Determining when a Lion Versioned document is locked/unlocked
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: [PARTIALLY SOLVED] Determining when a Lion Versioned document is locked/unlocked
      • From: Dave Fernandes <email@hidden>
  • Prev by Date: Re: About iVars declaration and property
  • Next by Date: Re: Implementing Full Screen for 10.7 but app should also run on 10.6
  • Previous by thread: Re: NSTextView - scroll programmatically to place the current line (where the text cursor is) in the middle.
  • Next by thread: Re: [PARTIALLY SOLVED] Determining when a Lion Versioned document is locked/unlocked
  • Index(es):
    • Date
    • Thread