On May 8, 2015 at 1:09:01 PM, Quincey Morris 
(quinceymor...@rivergatesoftware.com) wrote:
In this case, the text view should probably use the document undo manager, 
though you may have to do extra work to coordinate its use with your document’s 
needs. To configure it, you should tell the text view what its undo manager is, 
via its ‘undoManagerForTextView:’ delegate method.


My NSTextViewDelegate section begins like this:

extension Document : NSTextViewDelegate {  /// Plug document undo manager into 
the text v

  func undoManagerForTextView( view:NSTextView )
    -> NSUndoManager?
  {
    var um = self.undoManager
    describeUndoManager( um, 
source:"NSTextViewDelegate.undoManagerForTextView:" )
    return self.undoManager
  }

I think the delegate is good, because its other methods get called. But this 
one doesn’t. I tell the text view its delegate is my Document instance as soon 
as possible in windowControllerDidLoadNib: — right after I test and find that 
my Document’s undoManager is NOT nil. So the situation remains that the 
Document has an undoManager, but the text view’s undoManager variable remains 
nil throughout execution. Is there still a step I’m missing?
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to