2
\$\begingroup\$

Actually i am working with cocos2d Game. I am using CCLayer for particular scene. now there are so many buttons means CCMenuitems are available. I want to disable that all menuitems having same tags.

\$\endgroup\$

1 Answer 1

3
\$\begingroup\$

I'm not sure what the best way to do this is but the way I would do is by putting all the children into an array. Then iterate trough the array:

WhateverYouNeed *thingInArray;
CCArray *theArray = [self children];
for thingInArray in theArray {
  if ([thingInArray tag] == whateverTheTagIs) 
    do some stuff to thingInArray
}
\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .