Changes

Jump to: navigation, search

Obj-C Exceptions In Gecko

29 bytes added, 18:04, 14 February 2008
no edit summary
When wrapping calls in a method, the first choice you'll have to make is whether to wrap specific calls or the whole method impl. Which one you pick is usually a matter of cleanliness. If there is a big method with a single Apple framework call in it, you might just want to wrap that specific call. Your choice of macros are these:
* For wrapping calls that are not expressions, do not return values (at least not ones we care about)
** <code>NS_OBJC_TRY_IGNORE</code>
** <code>NS_OBJC_TRY_ABORT</code>
 
An example of these in use:
 
<code>NS_OBJC_TRY_ABORT([bar doSomething]);</code>
* For wrapping expressions that return a value
** <code>NS_OBJC_TRY_EXPR_ABORT</code>
An example of non-EXPR macro usage: <code>NS_OBJC_TRY_ABORT([bar doSomething]);</code> An example of EXPR macro usage is:
<code>foo = NS_OBJC_TRY_EXPR_ABORT([bar doSomething]);</code>
Confirm, emeritus
1,680
edits

Navigation menu