does code in finally get run after a return in objective-c?
        Posted  
        
            by Kevlar
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Kevlar
        
        
        
        Published on 2010-06-03T19:15:07Z
        Indexed on 
            2010/06/03
            19:34 UTC
        
        
        Read the original article
        Hit count: 261
        
objective-c
|try-catch-finally
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.
© Stack Overflow or respective owner