Re: try / finally
Re: try / finally
- Subject: Re: try / finally
- From: Greg Titus <email@hidden>
- Date: Tue, 20 May 2003 18:54:58 -0700
Because he wants to reraise the exception. If you don't want to repeat
the cleanup twice in Obj-C you need to do something like:
NSException *exception = nil;
NS_DURING
...
NS_HANDLER
...
exception = localException;
NS_ENDHANDLER
// clean up
[exception raise]; // will do nothing if exception is still nil.
Hope this helps,
- Greg
On Tuesday, May 20, 2003, at 06:40 PM, Scott Anguish wrote:
why not
NS_DURING
...
NS_HANDLER
...
NS_ENDHANDLER
// cleanup
On Tuesday, May 20, 2003, at 06:56 PM, Simon Bovet wrote:
Is there any way in ObjC/ObjC++ to write a termination block, such as
the try { ... } finally { ... }, or do I have to rewrite twice the
cleaning up lines in
NS_DURING
...
// clean up
NS_HANDLER
...
// clean up
[localException raise];
NS_ENDHANDLER
I guess so. I'm just wondering...
_______________________________________________
MacOSX-dev mailing list
email@hidden
http://www.omnigroup.com/mailman/listinfo/macosx-dev
_______________________________________________
MacOSX-dev mailing list
email@hidden
http://www.omnigroup.com/mailman/listinfo/macosx-dev
_______________________________________________
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.