NSTableDataSources and multi-threading
NSTableDataSources and multi-threading
- Subject: NSTableDataSources and multi-threading
- From: Sean Gilbertson <email@hidden>
- Date: Tue, 4 Nov 2003 02:11:53 -0600
Hello all,
I have a data source, whose represented data is updated by several
threads. Because of this, the result of numberOfRowsInTableView: may
not be valid by the time tableView:objectValueForTableColumn:row: is
called. I have tried several ways of making sure that this does not
occur, including subclassing NSTableView and notifying the data source
when reloadData is called, but of course that is not the appropriate
place to look for redrawing of the table view; it is an auxiliary
method. Of course, I am using locks, but they are almost worthless
unless I can actually guarantee incorrupt output.
If anyone has a good method for guaranteeing authentic and reliable
calls to table data source methods, as I have described them, please
let me know -- brainstorming has brought no easy solutions. Note that
copying the data represented by the data source does not help, because
even this copy can change between calls to numberOfRowsInTableView: and
tableView:objectValueForTableColumn:row:.
Thank you very much,
Sean
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.