Re: Objective-C Question
Re: Objective-C Question
- Subject: Re: Objective-C Question
- From: Chris Hanson <email@hidden>
- Date: Mon, 22 Sep 2003 17:23:15 -0500
On Monday, September 22, 2003, at 05:09 AM, Marcel Weiher wrote:
Precisely. Anyway, gcc 3.3 now has exceptions "built-in", apparently
to appease those who think that this "must" be a language feature.
Functionally, I have a hard time detecting any difference. Maybe if I
squint right...
The @finally clause is convenient. Instead of
NS_DURING {
// something that could raise
// do any necessary clean-up
}
NS_HANDLER {
// handle the exception
// do any necessary clean-up (repeated from the NS_DURING block)
}
NS_ENDHANDLER
you can write
@try {
// something that could throw
}
@catch (NSException *exception) {
// handle the exception
}
@finally {
// do any necessary clean-up
}
Yeah, it's better to not need the clean-up in the first place, but if
you do need it it's better to remove the duplication.
-- Chris
--
Chris Hanson, bDistributed.com, Inc. | Email: email@hidden
Custom Mac OS X Development | Phone: +1-847-372-3955
http://bdistributed.com/ | Fax: +1-847-589-3738
http://bdistributed.com/Articles/ | Personal Email: email@hidden
_______________________________________________
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.