如何更改以前使用的按钮的功能?例如,如果我有一个“继续/取消”按钮,假设您“继续”,那么按钮会变成“查看/返回”之类的东西吗?基本上我想将相同的按钮重新用于其他事情,但是因为我不知道有人可以如何帮助我更好地理解它。谢谢你。
- (IBAction)someButton:(NSButton *)sender {
if ([someString isEqualToString:someThing]) {
isAllowed = YES;
[oneButton setTitle:@"Proceed"];
[self continue];
}
else {
[oneButton setTitle:@"Cancel"];
return;
}
}
- (void)continue {
// I would like to make someButton (above) take on different functionality
// here if that's even possible. such as:
[oneButton setTitle:@"View"];
[self whatNow];