Snowcrash
Snowcrash

Reputation: 86347

expr (void)NSLog(@"someString is %@", someString)

I've got this as a Debugger Action in a breakpoint:

expr (void)NSLog(@"someString is %@", someString)

but it's barfing with:

error: warning: expression result unused
error: cannot find interface declaration for '$__lldb_objc_class'
error: cannot find interface declaration for '$__lldb_objc_class'
error: 2 errors parsing expression

Why's it not working?

====
UPDATE

I tried this in a completely new Xcode project. And it works fine. So, to be clear, this line has no syntactical problems in Xcode 4.6:

expr (void)NSLog(@"someString is %@", someString)

However, copying the exact same line from the breakpoint to my previous Xcode project results in the same problem.

Could it be something I've changed in the Build Settings for this specific project?

Upvotes: 0

Views: 634

Answers (2)

Kelly Bennett
Kelly Bennett

Reputation: 725

Make sure that you are not reaching this code from within a block. This would explain why the same breakpoint works in a new project but not in the other. This is what happens when trying to print the value of objects while at breakpoints within blocks. The solution is to use an NSLog in the block to do the printouts rather than using breakpoints. It's annoying, I know.

Upvotes: 3

trojanfoe
trojanfoe

Reputation: 122458

Unless you copied that incorrectly, I would say the double-quote characters are invalid. How about:

expr (void)NSLog(@"someString is %@", someString)

If you did copy it correctly, then it's a known bug.

Upvotes: 1

Related Questions