MacOS High Sierra and CAShapeLayers, NSImageView, NSTableView confilcts

I updated macOS High Sierra and now I have unexpected problems in my project, problems that were not seen before in macOS Sierra. I have a custom NSImageView, and then drag and drop the images in this NSImageViewI can draw a rectangle over the image with the features CAShapeLayersand mouseDown, mouseDragged. Then I can calculate the intensities of the parts of the image inside the rectangles. Intensity data is presented in the array, and this array is used for NSTableView. NSImageViewand NSTableVieware in the same NSView. Intensity calculation is performed as a function@IBAction. After updating, when I clicked the button to calculate the intensities, the rectangles moved below the image (before they stopped at the top). I found out that the reason for this effect is the reloadData()function for the table. When this function is turned off, rectangles remain on top of the image.

Can someone explain these strange things and what can I do to fix it? I need to save the rectangles above the image after clicking the calculation button.

Update I updated High Sierra, but reloadData()for NSTableView it has the same effect on fading CAShapeLayersas before.

+4
source share

Source: https://habr.com/ru/post/1686400/


All Articles