view1.h文件
@property(nonatomic,strong) NSView *aboutView;
在view1.m文件中创建了 NSView
aboutView = [[NSView alloc]initWithFrame:NSMakeRect(6, 6, width -12, height -29)];
[aboutView setHidden:YES];
[view addSubview:aboutView];
NSImageView *imgl=[[NSImageView alloc]initWithFrame:NSMakeRect(0, 0, width -12, height -29)];
[imgl setImageAlignment:NSImageAlignBottomLeft];
[imgl setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[imgl setImageScaling:NSImageScaleAxesIndependently];
[imgl setImage:[NSImage imageNamed:@"yuan"]];
[aboutView addSubview:imgl];
ButtonController.m 中的NSView如何找到和隐藏 NSView ?
-(void)mouseUp:(NSEvent *)theEvent{
NSView *aboutView = [(view1 *)self.superview.window aboutView];
[aboutView setHidden:NO];
}