Docs by Contradiction: -isDocumentEdited vs. -updateChangeCount:
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