我有一个包含一些对象组合的模型类,但我不知道为此编写迭代器的最佳方法。要更详细地查看问题,这里是层次结构(半伪代码):根类:MYEntity:NSObject@propertyintcommonProperty;@propertyNSArray*childs;//Childsofanykind.一些具体的子类:MYConcreteStuff:MYEntity@propertyintnumber;MYConcreteThing:MYEntity@propertyNSString*string;还有一个带有具体集合的根对象:MYRoot:MYEntity@propertyMYEntity*