如何使NSAssert在Xcode4中记录描述? [英] How to make NSAssert log the description in Xcode4?

查看:148
本文介绍了如何使NSAssert在Xcode4中记录描述?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Xcode 4告诉我NSAssert何时失败,但是不再记录assert描述和backtrace。我看到这个问题:

Xcode 4 tells me when an NSAssert has failed, but the assert description and backtrace are no longer logged. I have seen this question:

如何使Xcode4停止在NSAssert失败?

这是有帮助的,但我宁愿记录断言并继续。如何使NSAssert这样做?谢谢!

which is helpful, but I would rather log the assertion and continue. How can I make NSAssert behave this way? Thanks!

推荐答案

您链接的问题让您大部分时间都在那里。将断点操作添加到为断言设置的断点。从断点导航器中选择断点,右键单击,然后选择编辑断点。选择编辑断点将打开一个弹出编辑器。在弹出编辑器中,您将看到一个带有文本的操作行单击以添加操作。单击该文本以打开菜单。从操作菜单中选择日志消息。选择在评估操作后自动继续复选框在记录邮件后自动继续。

The question you linked to gets you most of the way there. Add a breakpoint action to the breakpoint you set for the assertion. Select the breakpoint from the breakpoint navigator, right-click, and choose Edit Breakpoint. Choosing Edit Breakpoint opens a pop-up editor. In the pop-up editor you should see an Action line with the text Click to add an action. Click that text to open a menu. Choose Log Message from the Action menu. Select the Automatically continue after evaluating actions checkbox to automatically continue after logging the message.

这篇关于如何使NSAssert在Xcode4中记录描述?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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