• 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
Compiler error when trying to catch a NSRangeException
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Compiler error when trying to catch a NSRangeException


  • Subject: Compiler error when trying to catch a NSRangeException
  • From: Randy <email@hidden>
  • Date: Sun, 27 Jul 2008 14:56:47 -0600

I have a try/catch in a method and I am trying to catch first an NSRangeException and secondly the general NSException. The code looks basically like.

@try
{
	//A bunch of stuff here .....
}
@catch (NSRangeException *nSRE)
{
	NSLog(@"Width exception: %@ %@", [nSRE name], [nSRE reason]);
	result = nil;
}
@catch (NSException * e)
{
	NSLog(@"%@ %@", [e name], [e reason]);
	result = nil;
}

I get a compiler error ...
"error: syntax error before NSRangeException"
I can't figure out why. I am assuming I should be able to catch that exception type
Any help or suggestions would be appreciated
Thanks


Randy Canegaly

_______________________________________________

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: Compiler error when trying to catch a NSRangeException
      • From: Charles Steinman <email@hidden>
  • Prev by Date: quit external application
  • Next by Date: Re: IB view transitions, CA, NSWindow animation
  • Previous by thread: Re: quit external application
  • Next by thread: Re: Compiler error when trying to catch a NSRangeException
  • Index(es):
    • Date
    • Thread