This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *sourceString = [[NSThread callStackSymbols] objectAtIndex:1]; | |
// Example: 1 UIKit 0x00540c89 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163 | |
NSCharacterSet *separatorSet = [NSCharacterSet characterSetWithCharactersInString:@" -[]+?.,"]; | |
NSMutableArray *array = [NSMutableArray arrayWithArray:[sourceString componentsSeparatedByCharactersInSet:separatorSet]]; | |
[array removeObject:@""]; | |
NSLog(@"Stack = %@", [array objectAtIndex:0]); | |
NSLog(@"Framework = %@", [array objectAtIndex:1]); | |
NSLog(@"Memory address = %@", [array objectAtIndex:2]); | |
NSLog(@"Class caller = %@", [array objectAtIndex:3]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// App Information | |
#define AppName [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleName"] | |
#define AppVersion [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleVersion"] | |
#define AppDelegate(type) ((type *)[[UIApplication sharedApplication] delegate]) | |
#define NSAppDelegate(type) ((type *)[[NSApplication sharedApplication] delegate]) | |
#define SharedApp [UIApplication sharedApplication] | |
#define NSSharedApp [NSApplication sharedApplication] | |
#define Bundle [NSBundle mainBundle] | |
#define MainScreen [UIScreen mainScreen] |