9

I want to enumerate all the nodes in my scene. Not just the ones that are a child of the scene itself, but also the children of those, and the children of those etc... So I want to be able to go through the whole node hierarchy.

Is there a method to do that without knowing how deep the node tree goes?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
notadam
  • 2,754
  • 2
  • 19
  • 35

1 Answers1

11

Yep, use enumerateChildNodesWithName:usingBlock: and pass //* as the node name. You should be able to call that on any node.

It's actually one of the examples in Apple's docs:

//* This search string matches every node in the node tree.

Mike S
  • 41,895
  • 11
  • 89
  • 84