NSWindow
, you can use the -makeKeyAndOrderFront: and -close methods. However, since these are UI things, they must be done on the main thread. You can still use your background routine, but when it comes time to manipulate the UI, those calls need to be dispatched onto the main thread in some way (eg dispatch_async).mycontroller * Mc; //in header
handling a message in .m file:
if (! Mc) {
Mc = [[mycontroller alloc] initWithWindowNibName:"aWindow"]; //alert window
}
[Mc showWindow:self];
[[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; //make sure window is up