0

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.

expr. not evaluated in GUI

Xcode 4.3.2.

What should I do?

Thanks

Radek Skokan
  • 1,358
  • 2
  • 15
  • 38

2 Answers2

3

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.

gaige
  • 17,263
  • 6
  • 57
  • 68
  • I'm happy about results from the command line debugger. I'd like to see the expressions evaluated in the GUI. And if I type "print [self isEditing]" when adding the expression in Xcode GUI, it still displays exactly this string, it doesn't get evaluated anyway. – Radek Skokan Jun 01 '12 at 13:36
  • I'm sorry I didn't illustrate this directly, but it is the same problem. You need to use "(BOOL) [self isEditing]" in the expression, not "[self isEditing]". Try adding a new expression like that. I'll update my answer. – gaige Jun 01 '12 at 14:09
  • Perfect, thanks gaige! When I explicitly say the expression result type, it works fine for all of them. BOOLs, NSString *s, ints, ... – Radek Skokan Jun 01 '12 at 21:50
0

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

Olaf
  • 3,042
  • 1
  • 16
  • 26
  • I still have to specify (looks like casting) the expression result type as Gaige wrote. It it works well from the GUI. – Radek Skokan Jun 01 '12 at 21:51