Re: Exception handling: confused by syntax
Re: Exception handling: confused by syntax
- Subject: Re: Exception handling: confused by syntax
- From: Mario Diana <email@hidden>
- Date: Fri, 13 Sep 2002 10:57:20 -0400
Okay, I think I've got it. If any kind of exception gets thrown, it's
caught in the NS_HANDLER block. In this example, if it's an
NSInvalidArgumentException, we handle it; and if it's some other kind of
exception, we throw it.
And sorry, I guess I should be saying raise and handle, instead of throw
and catch.
Thanks!
On Friday, September 13, 2002, at 10:28 AM, Nathan Day wrote:
- (void) myMethod
{
NS_DURING
// do the thing...
NS_HANDLER
if ([[localException name] isEqualToString:
NSInvalidArgumentException])
{
// handle the error...
}
else
{
[localException raise];
}
NS_ENDHANDLER
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.