| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On 3 Mar 2004, at 9:08 pm, Dustin Voss wrote:
On 3 Mar, 2004, at 10:32 AM, Jeremy Dronfield wrote:
My app has two separate text views (one in the main window, another in a drawer). Each has its own separate delegate, and I want each to have its own undo manager. (So that they can separately trigger an Unsaved Changes warning.) The trouble is, I can't figure out the correct implementation of the NSTextView delegate method:
- (NSUndoManager *)undoManagerForTextView:(NSTextView *)aTextView
{
return (what?);
}
There's no illumination in the FM, and I'm further confused by a reference by Bill Cheeseman (Omni archives) to this as an NSWindow delegate method, which it clearly isn't.
I'm not using NSDocument. Each text view has a delegate (an NSObject subclass).
Secondly, there is an NSWindow delegate method that supplies an undo manager. If a text view needs an undo manager, it follows the responder chain, and will get one of these (in order):
* One returned by the NSTextView delegate's -undoManagerForTextView:
That's the one I want. The documentation tells me that "If you want a text view to have its own NSUndoManager (and not the windows), have the text views delegate implement undoManagerForTextView:, to return the NSUndoManager." What it doesn't tell me is how to implement this method. What do I return?
| References: | |
| >Correct implementation of undoManagerForTextView (From: Jeremy Dronfield <email@hidden>) | |
| >Re: Correct implementation of undoManagerForTextView (From: Dustin Voss <email@hidden>) | |
| >Re: Correct implementation of undoManagerForTextView (From: Jeremy Dronfield <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.