Re: Bindings or datasource for a large NSTableView
Re: Bindings or datasource for a large NSTableView
- Subject: Re: Bindings or datasource for a large NSTableView
- From: Greg Herlihy <email@hidden>
- Date: Wed, 25 Jan 2006 22:18:27 -0800
- Thread-topic: Bindings or datasource for a large NSTableView
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
On 1/25/06 2:09 PM, "Dado Colussi" <email@hidden> wrote:
> Hi,
>
> first post, quite new to Cocoa and Mac in general. I have an external
> SQL database sitting somewhere with potentially large tables. I should
> display data from the tables on an NSTableView. It should be possible to
> perform sorting, searching and filtring on the data. I don't know how to
> implement this efficiently with NSArrayController and bindings. I found
> a short discussion about a similar problem on this list dated a few
> years back. Someone suggested implementing a cache-boosted data source
> that makes direct queries to the database [1]. It would allow me to have
> the database sort the records for me as well as to let me populate the
> table in a lazy manner (i.e. fetch the first N rows and fetch more after
> a cache-miss).
>
> I would appreaciate your comments and suggestions for alternative
> approaches.
>
> Thanks!
>
> Dado
>
> [1] http://lists.apple.com/archives/cocoa-dev/2003/Mar/msg01680.html
> _______________________________________________
> 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
_______________________________________________
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