Re: NSUndoManager in non-document based app using bindings
Re: NSUndoManager in non-document based app using bindings
- Subject: Re: NSUndoManager in non-document based app using bindings
- From: Patrick Machielse <email@hidden>
- Date: Wed, 15 Sep 2004 13:11:06 +0200
op 14-09-2004 16:41 schreef email@hidden
> 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).
The way to do this in IB (I believe) is to first instatiate an
NSObjectController to expose the properties of your model object, and then
bind an NSArrayController to this object controlller. So you end up with an
object controller for the account (which probably has more properties you
want to bind to than just the list of expenses), and an array controller for
the list of expenses.
You don't _have_ to instantiate the account in IB. In the object
controller's inspector Attributes pane you can specify the 'Object class
name' and flag 'Automatically prepares content', to have your model
instantiated on the fly by the controller. When your app grows you probably
want to instantiate it in IB though, so you can interact with it properly.
Patrick
---
Hieper Software
w: www.hieper.nl
e: email@hidden
_______________________________________________
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