I have a for in loop where I do not quite get the objects I expect to get.
I have a CCLayer class called MainLayer where I add children of class MyUniqueClass. However if I try to get all MyUniqueClass objects, I get other CCNode objects as well. Here’s what I do in MainLayer:
for (MyUniqueClass *mUC in self.children){
NSLog(@"%@", mUC); //Here I get all kinds of objects
}
Try to figure out why the CCNode objects are there. Somehow they’ve been added as children.
Or just ignore that and do this to filter out other node classes: