如何在xcode中打印或查看方法调用堆栈? [英] How to print or see method call stack in xcode?

查看:1917
本文介绍了如何在xcode中打印或查看方法调用堆栈?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的iPad应用程序上工作,

I working on my iPad App,

在表视图中运行代码时有一种方法。

While running the code there is one method in table view.

我们知道

`cellForRowAtIndexPath:`

此方法有几次可以调用。

There are several times this method can be called.

like while

like while

 scrolling table view cells.

 Or table view reload data.

我有复杂的编码,所以我只想看看方法调用堆栈...

I have complex coding so I just want to see method call stack...

我使用 NSLogs

code>和断点,但仍然无法获取。

I have used NSLogs and breakpoints but still could not get.

推荐答案

当您点击断点时,选择Debug导航器导航区域(窗口左侧):

When you hit a breakpoint, select the Debug navigator in the navigator area (left side of the window):

Debug导航器为您的应用程序中的每个线程显示一个堆栈跟踪。它显示了你从gdb的 backtrace 命令获得的基本相同的信息,但省略了返回地址(通常不是很有帮助)。使用导航器底部的控件隐藏或显示所有线程,并更改调整显示的堆栈帧数。我的滑块设置在它的范围的中间在上面的图像,并且调试导航器省略堆栈帧2-18,这是所有从一个框架方法调用到另一个,即不是我的东西。

The Debug navigator shows you a stack trace for each thread in your app. It shows you essentially the same information you get from gdb's backtrace command, but omits the return addresses (which normally aren't very helpful). Use the controls at the bottom of the navigator to hide or show all threads and to change the adjust the number of stack frames shown. I've got the slider set in the middle of its range in the image above, and the Debug navigator is omitting stack frames 2-18, which are all calls from one framework method to another, i.e. not my stuff.

Xcode 4应该被设置为在调试时自动显示Debug导航器,但是如果不是,你可以通过Xcode-> Behaviors-> Edit Behaviors ....然后从列表中选择运行暂停项,并将其设置为显示导航调试导航

Xcode 4 should be set up to display the Debug navigator automatically when you're debugging, but if not you can configure it to do so by going to Xcode->Behaviors->Edit Behaviors.... Then select the Run Pauses item from the list and set it to Show navigator Debug Navigator.

这篇关于如何在xcode中打印或查看方法调用堆栈?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆