Steps to Reproduce
- Query NSView.Subviews
- Observe that every time we call it, we marshal an array
Expected Behavior
We should have an API endpoint that exposes an NSArray.
Actual Behavior
There is none.
Notes
Scenario:
NSView view = ...;
for (int i = 0; i < view.Subviews.Length; ++i) {
var subView = view.Subviews [i];
...
}
The above code would marshal the array twice, every time we iterate. Also, array length queries would have to marshal the array to managed, so simply doing:
bool hasChildren = view.Subviews.Count > 0;
Having an NSArray based overload would avoid that and help for performance with multiple subviews in the NSView.
Steps to Reproduce
Expected Behavior
We should have an API endpoint that exposes an NSArray.
Actual Behavior
There is none.
Notes
Scenario:
The above code would marshal the array twice, every time we iterate. Also, array length queries would have to marshal the array to managed, so simply doing:
Having an NSArray based overload would avoid that and help for performance with multiple subviews in the NSView.