NSTextView invisible in app, visible in Debug View Hierarchy

After upgrading to Sonoma and Xcode 15, some of the NSTextViews in my app no longer show up. However, if entering Debug View Hierarchy, you can see them just fine.

This only seems to happen with certain views that are created programmatically.

Answered by Dalaplan in 768091022

Basically, it is caused by the fact that NSView clipToBounds is set to NO by default in Sonoma, but in Debug View Hierarchy it is still drawn as if clipToBounds were set to YES. This is obviously an Xcode bug.

If you can show this behavior in a small demo Xcode project, I think this would be a good issue to raise as a support incident with DTS.

Seems that the image view at the top is for some reason drawn over the textview at the bottom. If I remove the image view, the text view is visible again.

Accepted Answer

Basically, it is caused by the fact that NSView clipToBounds is set to NO by default in Sonoma, but in Debug View Hierarchy it is still drawn as if clipToBounds were set to YES. This is obviously an Xcode bug.

NSTextView invisible in app, visible in Debug View Hierarchy
 
 
Q