• 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: NSArrayController vs. fetch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSArrayController vs. fetch


  • Subject: Re: NSArrayController vs. fetch
  • From: mmalc crawford <email@hidden>
  • Date: Sat, 7 Oct 2006 14:33:02 -0700


On Oct 7, 2006, at 12:36 AM, Matteo Rossi wrote:


If you want to perform an operation on the content of a table view provided by an array controller, then use -arrangedObjects -- that's what it's there for...

Well, indeed, I don't want to perform an operation on a tableview, I use arrangedObjects to retrieve all entities of a certain kind and draw them on screen (they are lines); my primary goal is an ***UPDATED*** array of lines; the second one is a fast response. In other words I must be sure that all entities are correctly synchronized to the ones I creates/removed/modified. Is it correct that they are ONLY IF the tableview is displayed ? If I hide my tableview (or have no tableview at all) and add an entity programmatically, I think I'll have to run a fetch to retrieve all entities including the last one inserted. Am I wrong ? Is there a workaround for this ?


It's not clear what you're trying to achieve and why.

What the array controller contains (and the value of arrangedObjects) is determined by the setting of 'automaticallyPreparesContent' and the filterPredicate. It is not determined by the table view.

Assuming you're only using a single managed object context and only one application is updating the store, then setting automaticallyPreparesContent to YES means that the array controller keeps itself up-to-date with insertions and deletions -- this is described in <http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSArrayController_Class/Reference/Reference.html#//apple_ref/occ/instm/NSArrayController/setAutomaticallyPreparesContent: >.

mmalc


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSArrayController vs. fetch
      • From: Matteo Rossi <email@hidden>
References: 
 >NSArrayController vs. fetch (From: Matteo Rossi <email@hidden>)
 >Re: NSArrayController vs. fetch (From: mmalc crawford <email@hidden>)
 >Re: NSArrayController vs. fetch (From: Matteo Rossi <email@hidden>)

  • Prev by Date: Re: FSAllocateFork
  • Next by Date: Re: FSAllocateFork
  • Previous by thread: Re: NSArrayController vs. fetch
  • Next by thread: Re: NSArrayController vs. fetch
  • Index(es):
    • Date
    • Thread