• 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
Docs by Contradiction: -isDocumentEdited vs. -updateChangeCount:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Docs by Contradiction: -isDocumentEdited vs. -updateChangeCount:


  • Subject: Docs by Contradiction: -isDocumentEdited vs. -updateChangeCount:
  • From: Jerry Krinock <email@hidden>
  • Date: Mon, 18 Jan 2010 09:14:47 -0800

In documentation,

updateChangeCount:  "if the change count is 0, the document has no changes to save, and if the change count is greater than 0, the document has been edited and is unsaved"

isDocumentEdited  "Returns YES if the receiver has changes that have not been saved, NO otherwise."

I could write better code if I had a more direct definition.  If I interpret "document has been edited and is unsaved" to mean the same as "has changes that have not been saved", then the converse follows by contradiction and thus the implementation of -isDocumentEdited must be simply this:

- (BOOL)isDocumentEdited
{
    return (_changeCount > 0) ;
}

Am I correct?

Thanks!

Jerry

_______________________________________________

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: Docs by Contradiction: -isDocumentEdited vs. -updateChangeCount:
      • From: Corbin Dunn <email@hidden>
    • Re: Docs by Contradiction: -isDocumentEdited vs. -updateChangeCount:
      • From: Jerry Krinock <email@hidden>
  • Prev by Date: Re: CALayer with No Animation
  • Next by Date: Re: NSServices error parameter ignored?
  • Previous by thread: Re: NSServices error parameter ignored?
  • Next by thread: Re: Docs by Contradiction: -isDocumentEdited vs. -updateChangeCount:
  • Index(es):
    • Date
    • Thread