运行上述函数时的错误日志:
2013-06-28 21:10:32.435 B3 Controller[68665:c07] Logged knob : 1
2013-06-28 21:10:32.436 B3 Controller[68665:c07] -[ViewController rotaryKnobDidChange]: unrecognized selector sent to instance 0x71721f0
2013-06-28 21:10:32.437 B3 Controller[68665:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ViewController rotaryKnobDidChange]: unrecognized selector sent to instance 0x71721f0'
谢谢你帮助我。
这是代码:
... - (IBAction)rotaryKnobDidChange:(id)sender;
- (IBAction)rotaryKnobDidChange:(RotaryKnob*)sender
{
NSLog(@"Logged knob : %ld",(long)(sender.tag));
switch(sender.tag)
{
case 0:
self.driveLabel.text = [NSString stringWithFormat:@"%.0f%%", self.DriveKnob.value*100];
break;
case 1:
self.edgeLabel.text = [NSString stringWithFormat:@"%.0f%%", self.EdgeKnob.value*100];
break;
case 2:
self.reverbLabel.text = [NSString stringWithFormat:@"%.0f%%", self.ReverbKnob.value*100];
break;
}
}