Re: Access to NSArrayController's NSMutableArray?
Re: Access to NSArrayController's NSMutableArray?
- Subject: Re: Access to NSArrayController's NSMutableArray?
- From: Dave Sopchak <email@hidden>
- Date: Mon, 19 Jan 2004 12:39:25 -0800
Hey Mmalc,
On Jan 19, 2004, at 10:38 AM, mmalcolm crawford wrote:
On Jan 19, 2004, at 9:37 AM, Dave Sopchak wrote:
I replaced my NSMutableArray of guide stars with an
NSArrayController. So far things have been great, I can do more with
less code.
As in, you've replaced the array instance variable with a controller?
errr, yep, sort of...
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.
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?
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.
_______________________________________
The sun never sets on the search for darker skies.
_______________________________________________
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.