NSDocument updateChangeCount doesn't
NSDocument updateChangeCount doesn't
- Subject: NSDocument updateChangeCount doesn't
- From: Fred Glover <email@hidden>
- Date: Thu, 21 Oct 2004 18:09:15 -0700
I've got a simple Document based app. A document window contains three NSTextFields, and one NSTextView which I'm periodically appending a string to. So the NSTextView has a scrolling view of a series of appended strings (with \n between them) so I have a scrolling list of text entries.
I have my own application controller MyAppController : NSObject where I generate and append the strings. This all works including a Stop/Start pushbutton to add a repeating NSTimer to the run loop and to invalidate it under user control.
I want to mark the document "dirty" when I append a string to the NSTextView.
I have no intention of implementing Undo so in MyDocument init I do
[self setHasUndoManager:NO];
in MyDocument windowControllerDidLoadNib I tell my app controller who MyDocument is
myController = [[[MyAppController alloc] init] retain];
[myController setMyDoc:self];
in MyAppController updateMessageLog I do
[myDoc updateChangeCount:NSChangeDone];
The problem is the Document isn't marked dirty as verified by
NSLog (@"MyAppController myDoc isDocumentEdited:%d", [myDoc isDocumentEdited]);
// always prints "0"
and the Document window "dirty" button never gets turned on.
BTW I've checked Anquish, Buck & Yachtman, Hillegass 2nd Ed, Cheesman, all the Apple docs I can find and CocoaBuilder archives. Everything I find makes me think it Should Just Work.
Am I overlooking something which should be obvious?
Fred Glover
Machine Vision and Image Processing Engineering
Visicon Inc
www.visiconeng.com
Los Gatos, CA
408 354-0095 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden