Pretty simple question. I'm working in Objective C (cocos2d) and I'm trying to count the number of a sprites of a certain class are present on the current layer being displayed. For example, I have a class named
Seal which is a subclass of of
CCNode and in my current layer I want to count how many instances of type
Seal are present.
I know how to count the number of children of the layer by doing
int numberChildren = [[self children] count];
which correctly returns the number of children on the layer. But I just want the number of
Seals on my layer. How could I do this? Thanks =)