views:

43

answers:

1

I am pulling my data from sqlite and trying to show it in a UIWebView
I have tried

HTMLData = [container stringByReplacingOccurrencesOfString:@"\n" withString:@"<br />"];  

HTMLData = [HTMLData stringByReplacingOccurrencesOfString:@"\r" withString:@"<br />"];  
HTMLData = [HTMLData stringByReplacingOccurrencesOfString:@"\r\n"   withString:@"<br />"];  

[refweb loadHTMLString:HTMLData baseURL:nil];

but none of them seems to be doing the job. Any ideas?

A: 

This worked

HTMLData = [container stringByReplacingOccurrencesOfString:@"\

" withString:@"<br />"];  

what I did is I escaped the new line. I didn't just click "enter" while writing the code, but I copy/pasted from the database output in the console.

Adhamox