Skip to content

Instantly share code, notes, and snippets.

@mysteriouspants
Created September 9, 2011 18:39
Show Gist options
  • Save mysteriouspants/1206982 to your computer and use it in GitHub Desktop.
Save mysteriouspants/1206982 to your computer and use it in GitHub Desktop.
__PRETTY_FUNCTION__ Demonstration
#include <Foundation/Foundation.h>
typedef void (^voidBlock)();
@interface MyObject : NSObject
- (void)doSth;
@end
int main() { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSLog(@"%s", __PRETTY_FUNCTION__);
MyObject * foo = [[MyObject alloc] init];
[foo doSth];
[foo release];
[pool release]; return 0;
}
@implementation MyObject
- (void)doSth
{
NSLog(@"%s", __PRETTY_FUNCTION__);
voidBlock b = ^{
NSLog(@"%s", __PRETTY_FUNCTION__);
};
b();
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment