NSArrayController question
NSArrayController question
- Subject: NSArrayController question
- From: "Frank Bettger" <email@hidden>
- Date: Sun, 23 Sep 2007 14:50:31 +0200
I'm reading Hillegass book and in chapter 6 he introduces a project called
RaiseMan. It is a document-based application. In MyDocument.nib he creates
an instance of NSArrayController. With Inspector he opens the attributes
tab, sets the "Object Class Name" to Person and adds two keys called
personName and expectedRaise. (Person is a class that we have created
earlier which contains the two instance variables personName and
expectedRaise). He then creates a two column table, and using KVC he binds
the columns to NSArrayController and to personName and expectedRaise.
Now we come to chapter 7 and he wants to introduce undo capabilities to the
application. Instead of having NSArrayController keep its own array of
Person objects, he stores the array inside MyDocument, and sets the
NSArrayController's contentArray binding to use MyDocument's array as its
content. He does that by going to bindings inspector for the
NSArrayController. He expands the settings for the contentArray binding and
chooses File's Owner (MyDocument) from the Bind to: pop-up menu. He then
enter employees for the Model Key Path. (MyDocument has two instance
variables: employee which is a pointer to an NSMutableArray object and
personController which is a pointer to a NSArrayController object).
But Hillegass does not make any changes to the the attributes inspector for
the NSArrayController. The object Class Name is still Person and the keys
are still personName and expectedRaise. So what does this mean? Does our
NSArrayController have two arrays to keep track of. The first one that is
defined in attributes inspector for the NSArrayController, and the second
one defined in the NSArrayController's contentArray binding?
Thanks Frank
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden