Re: NSDocument updateChangeCount : unexpected behavior
Re: NSDocument updateChangeCount : unexpected behavior
- Subject: Re: NSDocument updateChangeCount : unexpected behavior
- From: Bill Cheeseman <email@hidden>
- Date: Mon, 01 Apr 2002 20:08:26 -0500
on 02-04-01 7:28 PM, Michael McCracken at email@hidden wrote:
>
I just ran into this weirdness with NSDocument: if you have a freshly
>
opened document with no changes, and call [doc
>
updateChangeCount:NSChangeUndone] (to unset a change) - it behaves
>
exactly as if the argument had been NSChangeDone - the window is marked
>
as changed and the user is prompted to save on a close.
If I recall correctly, this is documented behavior. NSChangeUndone just
decrements the change counter, and NSChangeDone increments it. Either way,
if you started with zero, it is now nonzero and the document is therefore
considered dirty. If you know the change count should be zero, you have to
make sure it stays zero. Simple accounting is required here.
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook -
http://www.AppleScriptSourcebook.com
Vermont Recipes -
http://www.stepwise.com/Articles/VermontRecipes
Croquet Club of Vermont -
http://members.valley.net/croquetvermont
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.