Below is a picture which might explain it better. I have a list of parent nodes in a treeview and I go through each one to make sure that they have child nodes. If they do then I go through each one of the child nodes in a for loop, but even when i = 0 it’s telling me it’s out of range, even though you can see that they exist.

They actually don’t exist.
Notice right above that
childCount: 0.What you’re seeing in the private array is pre-allocated space to hold any future children.