NSTableView not redrawing under specific conditions

259 Views Asked by At

I have a NSWindow with two NSTableViews and other NSViews. Since I have changed both NSTableView into view mode one of the tables, does not refresh correctly under specific conditions. When another view is placed on top and then removed and released, one of the nstableviews does not refresh its contents and the removed view remains visible. The tabledata is correctly reloaded and can even be used to select from a (non-visible) row. However a window resize immediately correctly refreshes and displays in both NSTableViews.

Can anybody help? Thanks. John

2

There are 2 best solutions below

0
On BEST ANSWER

How are you removing the view that's being removed? There are various methods which mention that they don't cause a redisplay and that you have to do that yourself. You probably need to call one of the -setNeedsDisplay... methods on either the view being removed, its superview, or if all else fails the table view.

0
On

Thanks for the suggestions. In fact it all turned out to be from the corrupted XIB file for the second view. After a few more changes, I started getting exceptions as well when the view started. After stripping out most of the subviews from the XIB and reinserting them, all the problems disappeared.