While in a breakpoint during a XCTest (and later during a normal run), I encountered something... odd. I think the screenshot below explains my problem:
Why does it claim An Objective-C constant string's string initializer is not an array
? It appears as if its attempt to translate my @""
NSString
literal sugar into an NSString
initializer-with-C-string was unsuccessful, but why?
Also, I've tested many other strings with the ¢
character or its Unicode escape sequence, and they all have the same result.
That looks like a bug. Please file it with http://bugreporter.apple.com.
Static string construction involves some compiler magic, and apparently lldb isn't getting that right when the string contains high-bit characters. You can achieve the same effect in the expression parser by using one of the NSString constructors:
(lldb) expr NSString *$newstr = [NSString stringWithUTF8String: "Something¢"]
(lldb) expr $newstr
(__NSCFString *) $newstr = 0x00000001007000a0 @"Something¢"
Then you can use $newstr in future expressions.