Content deleted Content added
Phil Boswell (talk | contribs) →[[Java (programming language)|Java]]: <source> |
Phil Boswell (talk | contribs) →[[Objective-C]]: <source> |
||
Line 132:
==== Exception declarations ====
<source lang=objc>
reason:@"whatever" userInfo:nil];
</source>
==== Raising exceptions ====
<source lang=objc>
</source>
==== Exception handling and propagation ====
<source lang=objc>
@catch (SomeException *se) {
// Handle a specific exception type.
...
▲ '''@try''' {
▲ '''@catch''' (NSException *ne) {
▲ // Handle general exceptions.
</source>
▲ // Propagate the exception so that it's handled at a higher level.
▲ }
▲ ...
▲ }
▲ '''@finally''' {
▲ // Perform cleanup, whether an exception occurred or not.
▲ ...
▲ }
===[[Ruby programming language|Ruby]]===
|