1

At first time click on Menuitem button event it run well .but when i load again -(id)init then Menuitem button event is not working. but Touch delegate is called.

i have use below code:

-(id) init
{
   if( (self=[super init]) )
    {
      FirstLable=[CCLabelTTF labelWithString:[[self.Ary_value objectAtIndex:RandomIndex]          valueForKey:@"First"] fontName:@"Arial" fontSize:20.0 dimensions:CGSizeMake(20, 20) hAlignment:UITextAlignmentCenter];
        FirstLable.position=ccp(80 ,300);
        FirstLable.color=ccRED;
        FirstLable.tag = 1;


        First_item = [CCMenuItemImage itemWithNormalImage:@"ButtonNum1.png" selectedImage:@"ButtonNum1.png" target:self selector:@selector(Num1:)];
        First_item.position=ccp(10, 7);
        menu1=[CCMenu menuWithItems:First_item, nil];
        menu1.position=CGPointZero;
        [FirstLable addChild:menu1];
        [self addChild:FirstLable];
    }
   }
Wez Sie Tato
  • 1,186
  • 12
  • 33
Kirit Modi
  • 23,155
  • 15
  • 89
  • 112

0 Answers0