• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSUndoManager in non-document based app using bindings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSUndoManager in non-document based app using bindings


  • Subject: NSUndoManager in non-document based app using bindings
  • From: Dirk van Oosterbosch <email@hidden>
  • Date: Tue, 14 Sep 2004 15:00:41 +0200

Hi,

in some sense this is a continuation of the thread left open in
http://www.cocoabuilder.com/archive/message/cocoa/2004/6/18/110021
I am trying to make a simple app with a tableView and I have a NSArrayController to manage it, using bindings. Now I would like to add undo functionality. But since I chose to *not* make it document-based, I'm having some problem implementing it.


I have an Expense class, that's my basic model.
And then I made an ExpensesAccount class holding a NSMutableArray of expenses, which I instantiated in IB, and bound programatically to the NSArrayController's contentArray (,since I wasn't able to bind this in IB). I am guessing this ExpensesAccount is also a model class, but is it really? (It seems a bit strange to instantiate a model class in IB).


However I do believe that I have to implement the undo functionality in this class (... acting a bit like a NSDocument subclass in document-based apps). But how do I get the proper NSUndoManager?
I've tried to give this class an IBOutlet NSWindow *myWindow and use NSUndoManager *undo = [myWindow undoManager] but that didn't work.
I also tried to make my class AppController delegate of that window and implemented -windowWillReturnUndoManager, but that made it worse: it made the menubar not respond and crash my app.


What is the proper way to implement undo in a non-document based app like mine, considering I want to use an NSArrayController?

thanks,
Dirk van Oosterbosch

_______________________________________________
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


  • Follow-Ups:
    • Re: NSUndoManager in non-document based app using bindings
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: 2 NSTextViews and binding
  • Next by Date: Re: Debugging "attempt to insert nil value" on customer's machine
  • Previous by thread: Re: 2 NSTextViews and binding
  • Next by thread: Re: NSUndoManager in non-document based app using bindings
  • Index(es):
    • Date
    • Thread