20 EYLÜL 2009, Pazar
Objective C yöntem arayan bul
Bir şekilde kod belirlemek için method
belli bir deniyordu var mı?
CEVAP
7 Mart 2012, ÇARŞAMBA
Stackİ bu yardımcı olur:
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]);
NSLog(@"Function caller = %@", [array objectAtIndex:4]);
Bunu Paylaş:
Objective-C - eğer bir yöntem varsa ko...
Objective-C yöntem C yöntem arıyor?...
Nasıl bir yöntem stacktrace veya yansı...
Nasıl Objective-C 2.0 içinde kullanım ...
Adı yönteminde arayan'yöntem adı ...