How do I hide a button when an IBAction is performed?
I am attempting to hide开发者_开发问答 a NSButton that performs miniaturize when a different NSButton on the interface is clicked. My attempts thus far have been unsuccessful, this is what I have tried:
.h file:
@interface AppDelegate : NSObject <NSApplicationDelegate> {
IBOutlet NSWindow *window;
IBOutlet WebView *webView;
IBOutlet NSButton *doMinimize;
}
@property (assign) IBOutlet NSWindow *window;
@property (assign) IBOutlet NSButton *button;
@property (nonatomic, retain) IBOutlet WebView *webView;
.m file:
@implementation AppDelegate
@synthesize window;
@synthesize webView;
@synthesize doMinimize;
- (IBAction)toggleFullscreen:(id)sender
{
...
[doMinimize setEnabled:NO];
[doMinimize setTransparent:YES];
...
}
It appears that no matter in what action I try to disable and make the button transparent, it doesn't seem to respond to anything. Do I have to give the button it's own class to make this work? If so, how would I then be able to modify that button from an IBAction inside of a different class?
I apologize in advance if my question is silly, I'm relatively new to the world of Objective-C and am just now starting to get my feet wet.
Thanks in advance.
Have you tried -setHidden:
?
[doMinimize setHidden:YES];
精彩评论