Re: Inserting objects in content array
Re: Inserting objects in content array
- Subject: Re: Inserting objects in content array
- From: Fritz Anderson <email@hidden>
- Date: Wed, 12 May 2004 16:47:39 -0500
If it were me, I'd consider the adding of the records to the array to
be an operation on the model, and use methods for altering the array
_in the model object_ that would be observable under Key-Value
Observation: Make the changes to the result of
mutableArrayValueForKey:, or make direct changes and bracket them with
will/didChangeValueForKey: or will/didChange:valuesAtIndexes:forKey:.
That way, the controller would update the display automatically, which
is why you have a controller in the first place, isn't it?
-- F
On 12 May 2004, at 2:45 PM, Don Rainwater wrote:
I have an application that retrieves records from a database, then
stuffs them into an array that is managed by an NSArrayController.
Currently, I put all of the returned records into the array myself,
then call [arrayController rearrangeObjects] to have the updated
content array displayed. This seems to be working fine, but would it
be better/faster to use [arrayController addObject:aRecord] instead?
--
Fritz Anderson
Consulting Programmer
http://resume.manoverboard.org/
_______________________________________________
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.