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 protected]) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
