Customers of my app experience a crash now in High Sierra. It happens in this code:
public override void AwakeFromNib()
View.Hidden = true;
View.WantsLayer = true;
var colorSpace = CGColorSpace.CreateDeviceRGB();
var colorComponents = new nfloat;
colorComponents = 0.18f;
View.Layer.BackgroundColor = new CGColor(colorSpace, colorComponents);
//FeedbackArea.WantsLayer = true;
FeedbackArea.Layer.BackgroundColor = new CGColor(colorSpace, colorComponents);
FeedbackArea.Layer.BorderWidth = 1;
Note the commented out 'FeedbackArea.WantsLayer=true;' line.
The thing is, FeedbackArea is a child of 'View'. On macOS Sierra, and all versions back to 10.7.5, this exact code runs without issue. According to the documentation:
Setting the value of this property to true turns the view into a layer-backed view—that is, the view uses a CALayer object to manage its rendered content. Creating a layer-backed view implicitly causes the entire view hierarchy under that view to become layer-backed. Thus, the view and all of its subviews (including subviews of subviews) become layer-backed. The default value of this property is false.
This is exactly the behavior observed in older OSs. Namely, when setting wantsLayer to True on View.WantsLayer, one notes that FeedbackArea.Layer is also immediately created.
It does not make a difference if View.Hidden = true is removed from this code.
Anyone else see this? I've not found anything indicating a change in behavior, but then, sometimes search-fu is bad.