• 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
@try/@catch() compile question.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

@try/@catch() compile question.


  • Subject: @try/@catch() compile question.
  • From: Clark Williams <email@hidden>
  • Date: Sat, 05 Mar 2011 16:22:29 -0800

I have the following code fragment within a method:
...
@try {
   NSLog ( @"try" );
} @catch ( NSRangeException *re ) {
   NSLog ( @"caught a: %@", [re name] );
}
...

I have made certain the Foundation.framework/NSException.h framework is available to the project and that Allow Exceptions are enabled in the project settings.

I get the following errors on the @catch line:
MainViewController.m:1206: error: expected declaration specifiers or '...' before 'NSRangeException'
MainViewController.m:1206: error: '@try' without '@catch' or '@finally'

Any suggestions would be appreciated.
ClarkW

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: @try/@catch() compile question.
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: How do I keep added folders current in my Xcode project?
  • Next by Date: Re: @try/@catch() compile question.
  • Previous by thread: Re: How do I keep added folders current in my Xcode project?
  • Next by thread: Re: @try/@catch() compile question.
  • Index(es):
    • Date
    • Thread