Re: NSTableView Loading Question
Re: NSTableView Loading Question
- Subject: Re: NSTableView Loading Question
- From: Keary Suska <email@hidden>
- Date: Tue, 4 May 2010 08:06:37 -0600
On May 4, 2010, at 7:45 AM, Donald Klett wrote:
> I want to make sure I am on the right track regarding the NSTableView class.
>
> In IB, I set the dataSource pointer to my object definition.
>
> Assuming the initial content of the table view is available, the table view will
> call the numberOfRowsInTableView method and since the return value is > 0, the
> objectValueForTableColumn method will be called that number of times to populate the table.
No, actually, NSTableView is optimized--it will only ask for the data that corresponds to visible rows. For large data sets I find using a data source is far more efficient than bindings.
> If the inital content is nothing, then I assume one has to call the reloadData
> method to cause the table to add entries as they become available.
>
> But this seems inefficient, since a call to reloadData reloads the entire table.
> Is there another route to take that I have not found?
Somehow, you have to let the NSTableView know that your data has changed. If your data set is so large that a -reloadData is not performant, you may just refresh the visible area as explained in the docs for -reloadData.
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden