2つのNSButtonがあり、両方ともIBActionです。片方のボタンをクリックすると、もう片方のボタンを非表示にします。それらを非表示にすることはできますが、もう一方を非表示にする方法がわかりません。これに対する私の実際の実装は、ユーザーがいくつかのタスクを実行し終えるまで非表示にされ、その後、他のオブジェクトが非表示になっている状態で再び表示される「開始」ボタンを持つことです。
ご協力いただきありがとうございます!
@interface Label : NSObject
{
IBOutlet NSTextField *myTextField;
}
-(IBAction)btnTest1:(id)sender;
-(IBAction)btnTest2:(id)sender;
-(IBAction)btnTest1:(id)sender
{
myTextField.stringValue = @"You selected the 1st Button";
NSButton *tempButton = sender;
[tempButton setHidden:YES];
}
-(IBAction)btnTest2:(id)sender
{
myTextField.stringValue = @"You selected the 2nd Button";
NSButton *tempButton = sender;
[tempButton setHidden:YES];
}