Hi everyone
My subclass of NSTreeController has a delegate, which can be set in IB. If no delegate is set, my subclass should act as the delegate. So I have to do this before awakeFromNib is called, which means in the init method of my subclass.
However, init and initWithContent are never called. I have no idea why. Some init method should be the first method that is called.
The content is provided by coredata.
Thanks
My subclass of NSTreeController has a delegate, which can be set in IB. If no delegate is set, my subclass should act as the delegate. So I have to do this before awakeFromNib is called, which means in the init method of my subclass.
However, init and initWithContent are never called. I have no idea why. Some init method should be the first method that is called.
The content is provided by coredata.
Code:
@synthesize delegate;
-(void) setDelegate:(id) value {
if (!value)
delegate = self;
delegate = value;
}
-(id) initWithContent:(id)content { printf("initwithcontent");
self = [super initWithContent:content];
if (self != nil) {
delegate = self;
}
return self;
}
Thanks