I created a Subclass of NSTextField. If i use it via code there's no problems, everything is fine and the component works as intended. If i use it via Interface Builder the component just won't show.
Here is my inits for the subclass:
-(instancetype)initWithFrame:(NSRect)frameRect{ self = [super initWithFrame:frameRect]; if(self){ [self setAlignment:NSTextAlignmentCenter]; [self setBackgroundColor:[NSColor blueColor]]; [self setBezeled:NO]; [self setEditable:NO]; [self setSelectable:NO]; [self.cell setUsesSingleLineMode:YES]; } return self; } -(instancetype)initWithCoder:(NSCoder *)coder{ self = [super initWithCoder:coder]; if(self){ NSLog(@"initWithCoder"); [self setAlignment:NSTextAlignmentCenter]; [self setBackgroundColor:[NSColor redColor]]; [self setBezeled:NO]; [self setEditable:NO]; [self setSelectable:NO]; [self.cell setUsesSingleLineMode:YES]; } return self; } For instance, if i create two components , one by code and one by Interface builder i can see only the first component, with blueBackground.
Any ideas? Thanks
NSTextFieldand change the class.