I have several NSButtons that are attached to a single IBAction. I need to differentiate inside the method between the different buttons. I tried the following, but it doesn’t work:
for (int i = 0; i++; i < 7) {
if (sender == [NSString stringWithFormat:@"button%i", i+1])
{
NSLog(@"sender is button %i", i+1);
}
}
How can this be made to work?
I’m averse to doing the work for you, but….
replace this line
with this line
Note too that the format of your for loop is invalid:
s/b: