objective c - How to find and hide the NSView? -


view1.h file

@property(nonatomic,strong) nsview  *aboutview; 

in view1.m file created 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]; 

nsview in buttoncontroller.m how find , hide nsview ?

-(void)mouseup:(nsevent *)theevent{     nsview *aboutview = [(view1 *)self.superview.window aboutview];     [aboutview sethidden:no]; } 

how

-(void)mouseup:(nsevent *)theevent{     view1 *viewobj=(view1 *)self.superview.window;     nsview *aboutview = [viewobj aboutview];     [aboutview sethidden:yes]; } 

Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -