I am new to Objective-C.I have a string like this and i need to display it in my iPhone App. Is there any UITextView that translates \n and \uxxx chars automatically?
NSString *text =
“What can you recommend?\u201D\n\u201CI\u2019m going to a barbecue and looking to take something a little different with me. What would you recommend?\u201D\n\u201CI\u2019ve heard a bit about low-carb beers, are any of them any good?\u201D\n\u201CI normally drink (X), but want to try something different. Can you recommend something?\u201D\n\n”.
I have tried
[WebView loadHTMLString:text baseURL:nil];
But It didn’t work. Any help is greatly appreciated.
Thanks.
You can use something like this:
and than put this NSString in any text view or text field.
Remember that stringWithUTF8String: takes const char* as an argument, so no “@” symbol in the front.