I'd like understand why if i try to set value (I.e. setAlphaValue or setTitle) for an object (like a NSButton) in init method nothing happen, but if i call setter function in awakeFromNib it works correctly.
@interface appController : NSObject {
NSButton *btn;
}
@end;
@implementation appController
-(void)awakeFromNib {
//it works
[btn setTitle:@"My title"];
}
-(id)init {
self = [super init];
if(self){
//it doesn't works
[btn setTitle:@"My title"];
}
}
@end
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…