Accessing IBOutlet of a controller in another class in COCOA

156 views Asked by At

I have a controller with a IBOutlet as follow :

@interface MyController : NSViewController <NSPopoverDelegate>
{
    IBOutlet NSWindow *detachedWindow;
}
@property (retain, nonatomic) NSWindow *detachedWindow;
@end

I want to access that outlet(detachedWindow) in a class that is: This subclass is added for a cell view in view based table view.

    @interface HoverTableRowView : NSTableRowView<NSTableViewDelegate,NSPopoverDelegate>   {
     __weak MyController *_delegateObject;
}

@implementation HoverTableRowView
@synthesize delegateObject = _delegateObject;
- (void)awakeFromNib
{
    NSLog(@"awake from nib is being called");
  NSLog(@"detached window outlet is--%@",[[self delegateObject ]detachedWindow]);

}
@end

But detached window outlet is-- is always returning null. How can I access that outlet in `HoverTableRowView' class ?

0

There are 0 answers