• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Inserting objects in content array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Inserting objects in content array
      • From: mmalcolm crawford <email@hidden>
References: 
 >Inserting objects in content array (From: Don Rainwater <email@hidden>)

  • Prev by Date: Re: Unsigned Long Long
  • Next by Date: Re: NSStatusItem, RunLoops and daemons (Oh My)
  • Previous by thread: Re: Inserting objects in content array
  • Next by thread: Re: Inserting objects in content array
  • Index(es):
    • Date
    • Thread