Slight problem with updates in NSTableView
Slight problem with updates in NSTableView
- Subject: Slight problem with updates in NSTableView
- From: j o a r <email@hidden>
- Date: Mon, 22 Oct 2001 14:58:53 +0200
Hi,
I have a problem with a workaround, but I'd like to understand why it
works this way.
I have a simple table view where I update one of the column values -
it's a status display that needs to show updated progress.
Whenever I have changed the value I call [myTableView reloadData], but
it doesn't show the updated values unless I manually select that row in
the table view. If I click-click-click in the table view I can "force"
it to display continuously updating values, but if I don't trigger the
redisplay in this way nothing happens.
As far as I know it's not a threading problem, since the process I'm
displaying progress on is running in a separate thread.
The workaround is in my case to tell the window containing the table
view to "display". Should this really be needed? According to the
documentation "reloadData" is supposed to set "setNeedsDisplay:YES" (at
least as far as I can tell).
// This call should suffice
[myTableView reloadData];
// ...especially coupled with these two
// [myTableView setNeedsDisplay:YES];
// [[myTableView window] displayIfNeeded];
// ...but I need to use this instead
[[myTableView window] display];
Are you supposed to "manually" tell the window (or topmost view) every
time you make a change in a subview? And why doesn't "displayIfNeeded"
work when "display" does?
Regards,
j o a r