What happens inside the try block?

Posted by dontWatchMyProfile on Stack Overflow See other posts from Stack Overflow or by dontWatchMyProfile
Published on 2010-06-10T09:07:35Z Indexed on 2010/06/10 9:13 UTC
Read the original article Hit count: 169

Filed under:

Example:

@try {
    // 1) do bad stuff that can throw an exception...

    // 2) do some more stuff

    // 3) ...and more...
}
@catch (NSException *e) {
    NSLog(@"Error: %@: %@", [e name], [e reason]);
}

If 1) throws an exception, is the block immediately canceled like a return in a function or a break in a loop? Or will 2) and 3) be processed no matter what happens in 1)?

© Stack Overflow or respective owner

Related posts about objective-c