Re: Access to NSArrayController's NSMutableArray?
Re: Access to NSArrayController's NSMutableArray?
- Subject: Re: Access to NSArrayController's NSMutableArray?
- From: Scott Anguish <email@hidden>
- Date: Mon, 19 Jan 2004 16:01:14 -0500
On Jan 19, 2004, at 3:39 PM, Dave Sopchak wrote:
Hmmm. I wouldn't say that the Controller is part of my model, but now
I can send messages to the ArrayController telling it to add or remove
guide objects in the array, where as before I was sending all this
stuff to the array directly.
So, then, I need to maintain an NSMutableArray in my model as before
and programatically link it to the NSArrayController I've instantiated
in IB, or instantiate my NSMutableArray in IB and connect the content
outlet of my NSArrayController to the NSMutableArray?
to the array, or to the model object that contains the array. there
is no need to do this programmatically. you can do this in IB.
You only need to maintain the NSMutableArray, but be sure to add
indexed accessor methods (see the KVC doc on accessor methods) to the
class that contains the NSMutableArray. If you use those accessor
methods to add/remove/replace items in the array, the NSArrayController
keeps track of the changes.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.