Why doesn't this work?
(lldb) po [NSString stringWithFormat:@"%f", 1.0]
error: too many arguments to method call, expected 1, have 2
error: 1 errors parsing expression
But this does:
(lldb) p (void)printf("%f", 1.0)
1.000000
Is Objective-C variable arguments syntax not supported in LLDB?
As Martin R pointed out in the comments, it's apparently a general LLDB issue with variable argument lists.
On the other hand, as Patrik Schmittat pointed out, -initWithFormat:
works just fine:
(lldb) po [[NSString alloc] initWithFormat:@"%f", 1.0]
1.000000
I've filed a radar for this: rdar://15261415 (stringWithFormat not working in LLDB)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With