我有三个 IBAction,每个都与它自己的按钮链接,如下所示:
#import "Controller.h"
#import "Application.h"
@implementation Controller
- (IBAction)deal:(id)sender {
NSButton *deal = (NSButton *)sender;
...
}
- (IBAction)hit:(id)sender {
NSButton *hit = (NSButton *)sender;
...
}
- (IBAction)stay:(id)sender {
NSButton *stay = (NSButton *)sender;
...
}
@end
您如何在其范围之外使用/调用按钮?我想做这样的事情:
- (IBAction)hit:(id)sender {
NSButton *hit = (NSButton *)sender;
...
[hit setEnabled: NO];
[stay setEnabled: NO]; // Using/altering "Stay's" button
}
提前致谢!