Debug Breakpoints - Display variable values in Log Message

这一生的挚爱 提交于 2019-12-11 20:07:20

问题


When I use the Log Message as Action in a Breakpoint is it still possible to print current variable values to the log output ?

When using a NSLog inline something like this is possible ...

NSlog(@"<DeleteArea> <State> CallToggle %i",[[deleteCardState userInfo] intValue]);

however in a breakpoint as Log Message using e.g. ...

@"<DeleteArea> <State> CallToggle %i",[[deleteCardState userInfo] intValue]

does not work.

How do you output formatted variables in breakpoints?


回答1:


You can do it as a Debugger Command as follows:

expression (void) NSLog(@"<DeleteArea> <State> CallToggle %i",[[deleteCardState userInfo] intValue]);


来源:https://stackoverflow.com/questions/18667479/debug-breakpoints-display-variable-values-in-log-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!