Is it possible?
I have a menu with 10 items, each item calls a function (should call the same function) with a different string.
so i end up having 10 different functions for example:
CCMenuItemFont * m0 = [CCMenuItemFont itemFromString:@"0" target:self selector:@selector(inf0:)];
CCMenuItemFont * m1 = [CCMenuItemFont itemFromString:@"1" target:self selector:@selector(inf1:)];
-(void)inf1:(id)sender
{
[self callAFunc:@"blaaaaa"];
}
-(void)inf2:(id)sender
{
[self callAFunc:@"blaaaaa2"];
}
is there a way i could set that up so i can just do:
CCMenuItemFont * m0 = [CCMenuItemFont itemFromString:@"0" target:self selector:@selector(inf:???)???];
CCMenuItemFont * m1 = [CCMenuItemFont itemFromString:@"0" target:self selector:@selector(inf:???)???];
-(void)inf:(id)sender data:(NSString *)data
{
[self callAFunc:@"data"];
}
thanks