• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Exception handling: confused by syntax
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: Exception handling: confused by syntax (From: Nathan Day <email@hidden>)

  • Prev by Date: Re: setFrameUsingName , setFrameAutosaveName
  • Next by Date: Re: mail.app plug-in API's
  • Previous by thread: Re: Exception handling: confused by syntax
  • Next by thread: Re: Exception handling: confused by syntax
  • Index(es):
    • Date
    • Thread