在COCOA中访问另一个类中的控制器的IBOutlet

时间:2013-08-13 10:45:13

标签: cocoa iboutlet nstablerowview

我有一个带有IBOutlet的控制器如下:

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

我想在以下类中访问该出口(detachedWindow):在基于视图的表视图中为单元视图添加此子类。

    @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

detached window outlet is--总是返回null。如何在“HoverTableRowView”类中访问该插座?

0 个答案:

没有答案