On Jan 18, 2010, at 9:14 AM, Jerry Krinock wrote:
> 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?
Please log some documentation bugs to get this clarified from engineering so we
can help you write better code. Ideally, provide an example of what you need
and why.
The actual implementation of the method is more complex; it also deals with
core data stuff currently being edited or not. But, it does do a != 0 compare,
since undoes do make it go negative.
corbin
_______________________________________________
Cocoa-dev mailing list ([email protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]