NSTableView redraw does not update display, select

Although I know about a solution to this problem, I am wondering if anyone can explain this solution to me. I also wanted to get this because I could not find a mention of this problem on the Internet, and it took me several hours for several days to track down. My NSTableView behaves strangely in terms of redrawing and selection. The problem looks like this:

The contents of the table disappear, instead of instantly appearing on the screen on the screen. When you scroll through the content, newly appearing lines also disappear. When you make a selection (one or more) and scroll it from the screen, then make another choice (which should replace, not add to the first selection), the first selection is not cleared properly. If you go to him, he will remain there, in addition to your new choice. This is a display update issue, not a selection issue - i.e. Your new choice is valid, it just doesn't display correctly.

I tracked this through the NSArrayController to which I was binding, to the base array, sorting, all connections and settings, etc., but all this has nothing to do with it.

Solved the problem: In the "View Effects" (rightmost) Inspector, uncheck the "Core Animation Layer" for the main window view.

Can someone explain what is happening here and possibly improve the solution?

+4
source share
1 answer

Core Animation and NSTableView don't seem to get along so well. The fade effect is a byproduct of basic animation. When you have the main animation in one view, it is also included in all these views of the view.

I do not recommend using basic animation on a Mac if it is absolutely necessary because some interface elements ( NSTextView and NSTableView , for example) are incompatible with it. iOS has much better support for table views and thus uses basic animation, mainly because it was designed with the main animation in mind.

I know that some simpler interface elements are compatible ( NSTextField and NSButton , for example).

If you need full kernel animation in the rest of the window, put all the other views in the content view, leaving the table view directly in the content view. You can then enable Core Animation in a different view.

Comments, feel free to add to the list of what is and is incompatible.

+2
source

All Articles