Skip to content

Instantly share code, notes, and snippets.

@mwahlig
Created August 7, 2015 17:40
Show Gist options
  • Save mwahlig/45b5846c778bcdae8728 to your computer and use it in GitHub Desktop.
Save mwahlig/45b5846c778bcdae8728 to your computer and use it in GitHub Desktop.
Print name of calling function to debug log
NSArray *syms = [NSThread callStackSymbols];
if ([syms count] > 1) {
NSLog(@"<%@ %p> %@ - caller: %@ ", [self class], self, NSStringFromSelector(_cmd),[syms objectAtIndex:1]);
} else {
NSLog(@"<%@ %p> %@", [self class], self, NSStringFromSelector(_cmd));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment