objective c - How to close window fired up from NSWindowController -


very nob question: want close window programmatically after sent http post body data. read documentation , implemented method - (void) performclose : ( id ) sender; , - ( bool ) windowshouldclose : ( id ) sender; never called. please can put me in right direction code provided below achieve mi target? thank gold time.

my code:

#import <cocoa/cocoa.h> #import <appkit/appkit.h>  //.h  @interface postinoclass : nswindowcontroller <nsurlsessiondatadelegate,      nsurlconnectiondelegate,nsurlsessiontaskdelegate,nsurlconnectiondatadelegate> {    nswindowcontroller *controllerwindow;  }  //.m - (void)openwindow {     // nslog(@"openwindow"); controllerwindow = [[nswindowcontroller alloc]initwithwindownibname:@"sendemailwindow"]; [controllerwindow showwindow:self];     } 

//ok can open cool window, need close after dirty work...

- (void)closewindow:(id)sender { // nslog(@"closewindow");  // [controllerwindow close]; // not work <-- [controllerwindow.window performclose:sender]; //not work <-- } 

[[self window] close]; that's it.

documentation link.


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -