It works fine when I add only one MenuItem. but when I go for other two MenuItems it crashes with exception ‘NSInvalidArgumentException’, reason: ‘+[NSInvocation invocationWithMethodSignature:]: method signature argument cannot be nil’
Here what i am doing
CCMenuItem *startGame = [CCMenuItemImage itemFromNormalImage:@"start-game.png" selectedImage:@"start-game.png" target:self selector:@selector(startGame:)];
CCMenuItem *settings = [CCMenuItemImage itemFromNormalImage:@"settings.png" selectedImage:@"settings.png" target:self selector:@selector(settings:)];
CCMenuItemImage *gameCentre = [CCMenuItemImage itemFromNormalImage:@"game-centre.png" selectedImage:@"game-centre.png" target:self selector:@selector(gameCentre:)];
CCMenu *menu = [CCMenu menuWithItems:startGame, settings, gameCentre, nil];
[menu alignItemsVerticallyWithPadding:10];
[self addChild:menu z:1];
here are my selector functions
-(void)startGame:(id)sender
{
NSLog(@"start game");
}
-(void)setttings:(id)sender
{
NSLog(@"settings");
}
-(void)gameCentre:(id)sender
{
NSLog(@"game centre");
}
Thanx in advance for any help
since your selectors do end with “:”, ie @selector(gameCentre:), make sure the methods in your class actually take argument