drawing NSView in Sequoia

In genealogy software, I have an NSView that displays a family tree where each person is in a subview. Before Sequoia, the subviews would draw in the order I add them to the parent NSView. For some reason, Sequoia calls drawRect in reverse order.

For example, a tree with cells for son, father, and mother used to be drawn in that order, but Sequoia draws them as mother, father, and son.

For static cell placement it would not matter, but these trees dynamically adjust as users change data or expand and contract branches from the tree. Drawing them in the wrong order messes up all the logic and many trees are corrupted.

Has the new drawing order been implemented for some reason and can it be changed? Is it documented?

A Solution: It appears that setNeedsDisplay has changed. My family tree is drawn in 2 passes: pass 1 calculates size of each tree cell. When that is done, tree cells (which are subviews in the main NSView) are moved to fill space by various options. Pass 2 then redraws all cells in their new proper locations.

My code called setNeedsDisplay on the main NSView after subviews are repositioned. Before Sequoia, this caused the entire view to redraw, but in Sequoia, only the main view gets redrawn. All subviews remain as they were draw during pass 1. The fix was to explicitly call setNeedsDisplay for every subview as well. I see setNeedsDisplay is deprecated, but it seems to have changed now too.

I still see subview cells drawing in reverse order compared to prior MacOS versions. Because I move cells to avoid overlap, it is not a problem in my window. It seems like that change would affect any application where subviews might overlap (and therefore drawing order would matter).

drawing NSView in Sequoia
 
 
Q