toggle quoted messageShow quoted text
Because I’m laying out the view using Manual Layout and the order of the subviews dictates where it is positioned.
It turns out to be a bug in XCode, if I quit XCode and look again it show the incorrect order, if I change it so its correct, save and try again all is fine.
To repeat the old, old counter-question…
What are you trying to accomplish? Why do you care?
Musings follow on why it might be futile to rely completely on array index.
The documentation for `-[NSView subviews]` says the order is usually Z order, or order of insertion, whether in the XIB or programmatically. Maybe insertion is the tiebreaker for Z.
For my part, I'd never keep creation order (if that's what order-in-XIB means) straight in my head. Rather than rely on index as a stable identified of a subview, it'd be easier to leave the ordering of `subviews` be and rely on the `tag` property of each subview for indexing.
On Jan 20, 2020, at 7:32 AM, Dave <dave@...> wrote:
I have a number of subviews in a view, in IB it looks like this:
However when I look in the Views subviews property in shows:
I thought that the order in IB was the order would same as the subviews array and it seems to be most of the time.
Is this not the case?
All the Best