• 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: Bindings or datasource for a large NSTableView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bindings or datasource for a large NSTableView


  • Subject: Re: Bindings or datasource for a large NSTableView
  • From: Camillo Lugaresi <email@hidden>
  • Date: Thu, 26 Jan 2006 19:01:26 +0100

On 26/gen/06, at 16:07, Dado Colussi wrote:

Greg Herlihy wrote:
I would definitely favor bindings over a data source delegate for
efficiency. An NSArrayController does populate the table in a "lazy" manner.
For example, if often defers data requests until a group of objects are
about to be scrolled into view..
Of course having the NSArrayControler sort the records would require
accessing all of them. So the strategy in this case would be to subclass
NSArrayController and implement its
- (NSArray*)arrangeObjects:(NSArray*)objects
method to have the database sort its records based on the
NSArrayController's current sort descriptors.
Greg


Hi Greg,

I don't see how this solves my problem. How does NSArrayController (or its subclass) know what part of the arrangedObjects an NSTableView is accessing in order to retrieve records from the database and manipulate the arrangedObjects on demand? I must be missing something obvious here.

Override arrangedObjects and return a custom NSArray subclass which acts as a proxy for the db query result set. The NSTableView will call its count and objectAtIndex methods as needed, and your implementation can fetch the requested information.


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


References: 
 >Re: Bindings or datasource for a large NSTableView (From: Greg Herlihy <email@hidden>)
 >Re: Bindings or datasource for a large NSTableView (From: Dado Colussi <email@hidden>)

  • Prev by Date: Re: I think I have found a big bug in NSBrowser
  • Next by Date: Re: I think I have found a big bug in NSBrowser
  • Previous by thread: Re: Bindings or datasource for a large NSTableView
  • Next by thread: Re: Bindings or datasource for a large NSTableView
  • Index(es):
    • Date
    • Thread