[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [NSApp stopModalWithCode:0];

From: Fred Kiefer
Subject: Re: [NSApp stopModalWithCode:0];
Date: Fri, 11 Aug 2006 23:41:20 +0200
User-agent: Thunderbird (X11/20060527)

Marc Brünink schrieb:
> if I send a [NSApp stopModalWithCode:0]; while I'm not in a modal
> session I get a NSInvalidArgumentException. This is not engraved in the
> Openstep Spec and behaves different in Cocoa. So I think this should be
> changed. Anyone disagree? The bad thing about this one is that I do not
> get the exception but a panel. So I am not able to catch it. Or......
> I'm too sleepy. :-)

I think you are just wrong here. stopModelWithCode: should only be
called from within a modal session. It would not do much harm to not
raise an exception here, but some errors may go undetected then. You
should be glad that GNUstep tells you that your code is wrong, where
Cocoa seems to leave you in the dark.

I don't have an idea what you are trying to do, but the documentation
states clearly that you should not call this method from outside the
event processing of a modal window. If you really need to call this
method you could work around by checking [NSApp modalWindow]first. But I
think this is wrong, but I cannot tell you a correct solution without
knowing the actual problem you are going to solve.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]