Very cool indeed, I can use that.
What do I do if I have different kinds of objects per level?
You have to take care of that somehow in the children block. The level option is one possibility to distinguish between objects. Another one is a "isKindOf:", but that you can do yourself.
Aha, ok. I was quickly looking at the code but couldn't figure out how the specification of the different selectors at different levels worked :-)
It would be interesting to offer other means of mapping (maybe something that builds a map behind the scene), but I would not know how to do that. If you have ideas, I would be happy to hear them :).
I was thinking/expecting more something along a meta-model for trees.
For now I guess the current implementation is fine, I just need to implement some unique selector in all the objects that will be part of the tree that returns their children.
Lukas