How do I call setStatus
from within awakeFromNib
?
-(void)awakeFromNib {
setStatus; // how?
}
/* Function for setting wind开发者_运维知识库ow status */
- (void)setStatus {
[statusField setStringValue:@"Idle"];
}
In Objective-C, you use self
to refer to the current object:
[self setStatus];
Maybe you might want to revise that method to be this:
- ( void ) setStatus: ( NSString *) status {
[ statusField setStringValue: status ];
}
You can then call it like this:
[ self setStatus: @"Idle" ];
精彩评论