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\$
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\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.