Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make NSAssert log the description in Xcode4?

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

How to make Xcode4 stop at NSAssert failure?

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

like image 699
Lou Zell Avatar asked Dec 07 '11 06:12

Lou Zell


1 Answers

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.

enter image description here

like image 153
Swift Dev Journal Avatar answered Oct 20 '22 00:10

Swift Dev Journal