• 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
NSArrayController content modification vs addObject:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSArrayController content modification vs addObject:


  • Subject: NSArrayController content modification vs addObject:
  • From: AurĂ©lien HugelĂ© <email@hidden>
  • Date: Thu, 02 Mar 2006 11:18:11 +0100

Hi list !

myArrayController is bound to MyController, with keypath:@"someObjects" (someObjects accesors is -(NSMutableArray*) someObjects)

What is the difference between [myArrayController addObject:anObject] and [[myArrayController content] addbject:anObject] ?

i have noticed that using [myArrayController addObject:anObject] is VERY slow in my case, because this method refreshes the "content" of the array controller by using KVC, the -(NSMutableArray*)someObjects methods is called, and it is a quite slow method (suppose i have to get datas from a slow server)

using [[myArrayController content] addbject:anObject] is very fast because the content of the array controller is not refreshed (- (NSMutableArray*)someObjects methods is NOT called again)

why does addObject: method of NSArrayController needs to refresh its content again using valueForKey:@"someObjects" again ? the content of the array controller is *already* in the NSArrayController (it is almost equal to arrangedObjects...) ?

thanks

Aurelien
_______________________________________________
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


  • Prev by Date: CoreData updating of NSTableView cells
  • Next by Date: Re: CoreData updating of NSTableView cells
  • Previous by thread: Re: CoreData updating of NSTableView cells
  • Next by thread: NSXMLDocument question
  • Index(es):
    • Date
    • Thread