how to terminate cocoa app in applicationWillFinishLaunching delegate

Posted by AmitSri on Stack Overflow See other posts from Stack Overflow or by AmitSri
Published on 2010-06-02T09:47:58Z Indexed on 2010/06/02 9:54 UTC
Read the original article Hit count: 312

Filed under:
|
|

I have to show the custom license Agreement dialog to the user before they start using my application.So, i have added new window in my mainMenu.xib and showing that window modally using

[NSApp runModalForWindow:licenseWindow];

in applicationWillFinishLaunching: delegate by making my main window hidden using visible at Launch to unchecked. License window has two buttons Agree and Disagree. I need to show the mainwindow if user clicks on Agree button and terminate the app if they choose Disagree.

I try to call [NSApp terminate]; in applicationWillFinishLaunching: but it didn't do anything.

Please let me know how i can terminate the app in applicationWillFinishLaunching:

Thanks

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about cocoa