• 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: My try/catch block isn't catching exceptions on 10.6
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: My try/catch block isn't catching exceptions on 10.6


  • Subject: Re: My try/catch block isn't catching exceptions on 10.6
  • From: Graham Cox <email@hidden>
  • Date: Fri, 27 Nov 2009 12:08:28 +1100

On 27/11/2009, at 10:51 AM, Mark Allan wrote:

> 	@catch (NSException *e) {
> 		NSLog(@"Splat! Reason: %@", [e reason]);


Maybe the exception isn't an NSException*, and therefore uncaught by this.

Does Objective C support multiple catch blocks, like C++? In other words you could do:

@try
{
 ...
}
@catch( NSException* e)
{
  // deal with NSException
}
@catch(...)
{
  // deal with any other sort of exception
}

If multiple catch blocks are not supported, you could just use the catch(...) variant though detecting what sort of exception it is becomes quite tricky.

--Graham



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: My try/catch block isn't catching exceptions on 10.6
      • From: Matt Gough <email@hidden>
References: 
 >My try/catch block isn't catching exceptions on 10.6 (From: Mark Allan <email@hidden>)

  • Prev by Date: Re: Custom Controls Where to start
  • Next by Date: Re: My try/catch block isn't catching exceptions on 10.6
  • Previous by thread: My try/catch block isn't catching exceptions on 10.6
  • Next by thread: Re: My try/catch block isn't catching exceptions on 10.6
  • Index(es):
    • Date
    • Thread