Thanks, applicationShouldTerminateAfterLastWindowClosed works. Now I'd like to prompt user if he really wants to quit, if not, return NO, that seems working as well. --- 2010年6月18日 星期五,Kyle Sluder <kyle.slu...@gmail.com> 寫道﹕
寄件人: Kyle Sluder <kyle.slu...@gmail.com> 主題: Re: terminates app when main window closes 收件人: "Angelo Chen" <angelochen...@yahoo.com.hk> 副本(CC): cocoa-dev@lists.apple.com 日期: 2010年6月18日,星期五,下午3:02 On Thu, Jun 17, 2010 at 11:41 PM, Angelo Chen <angelochen...@yahoo.com.hk> wrote: > I have a non document based application, I quit the app by sending terminate > to NSApplication(file owner). if I close the main window, application will > not be closed, what I'd like is, when user close the main window, application > also terminates, possible? Thanks, Non-document-based apps typically don't do this. That said, look at -applicationShouldTerminateAfterLastWindowClosed: in the NSApplicationDelegate protocol. --Kyle Sluder _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com