利用callStackSymbols打印
NSArray *array = [NSThread callStackSymbols];
NSString *method = NSStringFromSelector(_cmd);
if (array.count>1) {
NSString *methodOrigin = array[1];
method = [methodOrigin componentsSeparatedByString:@"+"][1];
}
NSLog(@"=== method:%@",method);
网友评论