• 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: NS_DURING and return
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NS_DURING and return


  • Subject: Re: NS_DURING and return
  • From: "Timothy J. Wood" <email@hidden>
  • Date: Mon, 13 Feb 2006 18:14:15 -0800


NS_VALUERETURN/NS_VOIDRETURN inside the NS_DURING/NS_HANDLER block can be used (see <http://developer.apple.com/documentation/Cocoa/ Conceptual/Exceptions/index.html>).


On the other hand, you can turn on ObjC exception syntax and then just use 'return' (the compiler will handle it) _and_ you can then use @finally (see <http://developer.apple.com/documentation/ DeveloperTools/gcc-3.3/gcc/Objective_002dC-Dialect-Options.html>)

-tim


On Feb 13, 2006, at 2:09 AM, Stephane Sudre wrote:

Stupid question:

Since the following code is not supported.

NS_DURING
	return something;
NS_HANDLER
	return anotherThing;
NS_ENDHANDLER

What other solutions exist?

1. using an intermediate var and moving the return outside the NS_DURING. That is the solution I'm using.

2. Is NS_VALUERETURN what shall be used instead of return in such a case?

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


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >NS_DURING and return (From: Stephane Sudre <email@hidden>)

  • Prev by Date: [Fwd: Re: why does this leak?]
  • Next by Date: Cocoa-heads Lake Forest MOVED to Thursday 2/16
  • Previous by thread: NS_DURING and return
  • Next by thread: Processing TIFF/PNG Layers
  • Index(es):
    • Date
    • Thread