Skip to content

Instantly share code, notes, and snippets.

@johanoloflindberg
Forked from itod/tryfinally
Created November 21, 2016 03:15
Show Gist options
  • Save johanoloflindberg/16c9fc7bbd5683370d0aa4eb1c8520b3 to your computer and use it in GitHub Desktop.
Save johanoloflindberg/16c9fc7bbd5683370d0aa4eb1c8520b3 to your computer and use it in GitHub Desktop.
Try/Finally with no exceptions in sight.
//
// main.m
// Finally
//
// Created by Todd Ditchendorf on 6/19/15.
// Copyright (c) 2015 Todd Ditchendorf. All rights reserved.
//
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
@try {
return 0;
}
@finally {
NSLog(@"OHAI");
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment