打印函数调用堆栈

    NSArray *syms = [NSThread  callStackSymbols];
    if ([syms count] > 0) {
        for (int i = 0; i < [syms count]; i++) {
                        NSLog(@"%@\n\n\n",[syms objectAtIndex:i]); 
        }
    } else {
        NSLog(@"<%@ %p> %@", [self class], self, NSStringFromSelector(_cmd));
    }

你可能感兴趣的:(打印函数调用堆栈)