问题描述:

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

网友答案:

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.

网友答案:

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

相关阅读:
Top