Undo and NSDocument problem.
Undo and NSDocument problem.
- Subject: Undo and NSDocument problem.
- From: Gus Mueller <email@hidden>
- Date: Tue, 15 Jul 2003 19:31:57 -0700
I'm finding that I'm in need of some advice here-
I've got a document based application that has multiple windows (and
window controllers) for a single document. Each window has a (custom)
NSTextView in it, and whenever I change text in one textview, all the
windows flip their "dirty bit" in the upper left hand corner of the
document's windows. That's fine- I'm happy with that.
However, a problem occurs when I do the following steps:
1. Have 2 windows (with a shared nsdocument subclass) open.
2. Edit window A, then close it.
3. Edit window B, then hit undo twice. At this point my app crashes.
The undo works fine the first time, but the second time I think it's
trying to undo the edit which occurred in window A.
Is this a bad design decision on my part? Having multiple windows tied
to a single document? Should I rework the application so that each
window has a single document?
I've thought about giving each window it's own NSUndoManager, but I
haven't quite figured out where to set that yet- it looks like each
window just ends up talking to the document's undo manager.
Any advice is appreciated.
thanks,
-gus
--
Flying Meat Software
http://flyingmeat.com/
"Christmas means carnage!" -- Ferdinand, the duck
_______________________________________________
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.