Re: Access to NSArrayController's NSMutableArray?
Re: Access to NSArrayController's NSMutableArray?
- Subject: Re: Access to NSArrayController's NSMutableArray?
- From: mmalcolm crawford <email@hidden>
- Date: Mon, 19 Jan 2004 12:46:56 -0800
On Jan 19, 2004, at 12:39 PM, Dave Sopchak wrote:
If so, you shouldn't do that. The controller is a controller -- it
shouldn't become part of your model. You should therefore be able to
modify the array contents much as you would have before, modulo
you'll probably have to use indexed accessor methods to add/remove
objects from the array (see archives).
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.
That's still a valid thing to do.
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?
Maintain the NSMutableArray as before, and bind the array controller's
content array to that array.
I suppose if I can get my head straight as to the way I can get these
things connected to each other, I'm home free.
Hmmm...a little bit of knowledge. I'll have to think about this one
some more.
There are a number of examples at:
<
http://homepage.mac.com/mmalc/CocoaExamples/controllers.html>
that may help clarify.
mmalc
_______________________________________________
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.