On 2010 Jan 18, at 09:14, Jerry Krinock wrote:
> - (BOOL)isDocumentEdited
> {
> return (_changeCount > 0) ;
> }
>
> Am I correct?
No, I was wrong. After getting the ivar offset from otool, I poked around with
gdb and found that _changeCount can actually be negative. This occurs if you
do several edits, save the document, then start Undoing. Exactly as specified
by -updateChangeCount documentation, the _changeCount decrements, to -1, -2,
etc.
The behavior does seem to be
- (BOOL)isDocumentEdited
{
return (_changeCount != 0) ;
}
I also confirmed another undocumented fact that I suspected, which is that
sending -updateChangeCount:NSChangeRedone causes changeCount to increment.
_______________________________________________
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]