langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
16
Task/Exceptions/Objective-C/exceptions-3.m
Normal file
16
Task/Exceptions/Objective-C/exceptions-3.m
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
@try {
|
||||
[self foo];
|
||||
}
|
||||
@catch (MyException *exc) {
|
||||
//Catch only your specified type of exception
|
||||
}
|
||||
@catch (NSException *exc) {
|
||||
//Catch any NSException or subclass
|
||||
NSLog(@"caught exception named %@, with reason: %@", [exc name], [exc reason]);
|
||||
}
|
||||
@catch (id exc) {
|
||||
//Catch any kind of object
|
||||
}
|
||||
@finally {
|
||||
//This code is always executed after exiting the try block
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue