Expression in Xcode 4.3.2 Debug area not evaluated

孤街醉人 提交于 2019-12-08 09:21:37

问题


I'm doing something wrong. I have added an expression, I can see the expression with the "E" symbol in the Debug area, but the expression is not being evaluated, its value is not displayed there (it is in scope at that time).

When I use the debugger (lldb) directly, it works well.

Xcode 4.3.2.

What should I do?

Thanks


回答1:


You are trying to evaluate a boolean and print it as an object.

You want to use print [self isEditing] or print (BOOL)[self isEditing], depending upon whether the debugger complains that it doesn't know the type of the member or not.

The po command prints an object description, not an arbitrary value, and should only be used when the result of the expression on the right is an object, such as po self.

The same problem occurs in the expression editor. If you use the expression [self isEditing], the debugger won't understand it. However, if you use (BOOL)[self isEditing], it will display correctly.




回答2:


try adding the expression as self.isEditing, without the square brackets. Works here



来源:https://stackoverflow.com/questions/10848578/expression-in-xcode-4-3-2-debug-area-not-evaluated

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