Edit corrupted html (& lt;) to fix one (<)
I have saved the html code in a variable NSString
to display in UIWebView
its work fine, but sometimes I get wrong syntax like this
<body><h3>Hazem Taha Ghareeb <small>report</small></h3>From: <p>2014-06-02 </p> To: <p>2014-06-16 </p><table><thead><th>Exam</th><th>Date</th><th>Result</th></thead><tbody></tbody></table><h3>Absence</h3><table><thead><th>Date</th></thead><tbody></tbody></table></body></html>
it should be like
<body><h3>Hazem Taha <small>report</small></h3>From: <p>2014-08-01 </p> To: <p>2014-08-05 </p><table><thead><th>Exam</th><th>Date</th><th>Result</th></thead><tbody><tr><td>Math exam </td><td>2014-08-03 </td><td>94 </td></tr></tbody></table><h3>Absence</h3><table><thead><th>Date</th></thead><tbody><tr><td>2014-08-04 </td></tr><tr><td>2014-08-05 </td></tr></tbody></table></body></html>
how can i fix it
Content is a file containing my html style
NSString * myPath= [[NSBundle mainBundle] pathForResource:@"content" ofType:@"txt"]; NSString *fileContent = [[NSString alloc]initWithContentsOfFile:myPath encoding:NSUTF8StringEncoding error:nil]; fileContent = [fileContent stringByAppendingString:reportBody]; NSLog(@"content file %@",fileContent); [web loadHTMLString:fileContent baseURL:[NSURL fileURLWithPath:myPath]];
+3
source share
No one has answered this question yet
See similar questions:
or similar: