Consider the following code:
@try {
if (something.notvalid)
{
return;
}
// do something else
} @catch (NSException *ex) {
// handle exception
} @finally {
NSLog(@"finally!");
}
If something
is not valid and I return from within the try, does the code in @finally
execute or not? I believe that it should but others I've spoken to don't think so and I'm unable to test this at the moment.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…