我的 NSSlider 上有一个事件,代码如下:
- (IBAction)optOndoorzichtigheidChange:(id)sender {
NSUserDefaults* defaults = [NSUserDefaults standardUserDefaults];
NSString *opacity = [NSString stringWithFormat:@"%d",[optOndoorzichtigheidSlider value]];
[defaults setObject:opacity forKey:@"opacity"];
[mainWindow setAlphaValue:[optOndoorzichtigheidSlider doubleValue]];
[defaults synchronize];
[optOndoorzichtigheidLabel setStringValue:opacity];
NSLog(@"fired");
}
但它没有触发,控制台给出了这条消息:2011-01-09 19:31:18.994 Nistract[1337:a0f] -[NSSlider value]: unrecognized selector sent to instance 0x100427400