I got this error, do I need to use a specific syntax to use an enum in LLDB ?
(lldb) expr NSString *$text = [[NSString alloc] initWithData:$data encoding:NSUTF8StringEncoding]
error: use of undeclared identifier 'NSUTF8StringEncoding'
error: 1 errors parsing expression
Note: data is valid in my context and of the right type
Edit when using the actual instead of the enum I get
expr NSString *$text = [[NSString alloc] initWithData:$data encoding:(NSStringEncoding)4]
error: no known method '-initWithData:encoding:'; cast the message send to the method's return type
error: 1 errors parsing expression
I have tried with and without the cast to (NSStringEncoding)
Solution to use the value
expr NSString *$text = (NSString *)[[NSString alloc] initWithData:$data encoding:4]
Since I was using -initWithData:encoding: (with a type of NSUInteger for encoding) lldb could not infer the return type of the whole method so I had to cast the return type as well.