I have a NSTextField which I subclassed from NSTextField and I want that a new NSTextField appears when my TextField gets focus. I changed the method becomeFirstResponder
, which also works, cause it prints "TextField got focus" in the log area.
But the appearance / disappearance doesn't work for my second TextField. Its also connected in the IB.
Here is the code:
@interface MyNewTextField : NSTextField{
IBOutlet NSTextField* TestTextFiel;
}
MyNewTextField.m:
#import "SollkontoFeld.h"
@implementation SollkontoFeld
- (void)drawRect:(NSRect)dirtyRect {
[super drawRect:dirtyRect];
}
-(BOOL)becomeFirstResponder{
[testTextFiel setHidden:NO];
NSLog(@"TextField got focus");
return YES;
}
@end
The methods is obviously correctly executed cause the text is printed. I assume that my code for the appearance / disappearance is false.