• 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: NSDocument's isDocumentEdited
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDocument's isDocumentEdited


  • Subject: Re: NSDocument's isDocumentEdited
  • From: Graham Cox <email@hidden>
  • Date: Sun, 20 Jul 2008 22:17:56 +1000

Normally you "tell" a document that it is edited in one of two ways - either a) by maintaining an Undo stack in which case it "just works", and b) by calling -updateChangeCount: The method you mention is a lower level method that is not meant to be overridden, as far as I'm aware. If you use -updateChangeCount: the window dirty state is handled for you - if not using Undo then you'd just call this for each change of state in your data model that should mark the document dirty.

hth,


Graham



On 20 Jul 2008, at 9:31 pm, John Love wrote:

Within MyDocument's isDocumentEdited I have code to determine whether
MyDocument is edited and return the BOOLean flag accordingly.

I then discovered that the only way to set the window's "dirty" flag was to
*explicitly* call [window setDocumentEdited:editedFlag] within other methods
by duplicating the same code I have in MyDocument's isDocumentEdited method,
followed by setDocumentEdited on the window.


My "off the wall" guess *was* that Cocoa's main event loop called
isDocumentEdited and then set the window to "dirty" if needed. This guess
is wrong, or otherwise I would not have had to set the window to "dirty"
elsewhere.


Anyone have a clue here?

Cheers, John Love
_______________________________________________

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

_______________________________________________

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: NSDocument's isDocumentEdited
      • From: "John Love" <email@hidden>
References: 
 >NSDocument's isDocumentEdited (From: "John Love" <email@hidden>)

  • Prev by Date: Re: Obtaining the number of characters in a string
  • Next by Date: Re: Obtaining the number of characters in a string
  • Previous by thread: NSDocument's isDocumentEdited
  • Next by thread: Re: NSDocument's isDocumentEdited
  • Index(es):
    • Date
    • Thread