0
我不理解怎麼去CDATA的內容,我如何在iPhone SDK中將CDATA內容導入UIWebView?
NSString* htmlString = [self getnerateFormattedString:details];
[webView loadHTMLString:htmlString baseURL:[NSURL URLWithString:@"http://www.myWebsite.com"]];
-(NSString*) getnerateFormattedString:(TrackDetails*) details
{
NSString* htmlString = @"";
htmlString = @"<html><head><title><style type=\"text/css\">a {color: red}</style>";
htmlString = [htmlString stringByAppendingString:@"</title></head><body style='background-color: transparent;'> "];
if (atrackDetails.trackTitle != nil)
{
htmlString = [htmlString stringByAppendingString:@"<div align='center' >"];
htmlString = [htmlString stringByAppendingString:@"<font size='4'>"];
htmlString = [htmlString stringByAppendingString:details.trackTitle];
htmlString = [htmlString stringByAppendingString:@"</b></font></div><br>"];
}
htmlString = [htmlString stringByAppendingString:@"<table width=300px cellpadding=5 cellspacing=5 border=0 align='center' height=10px> "];
喜歡我現在用loadHTMLString加載。但我不知道如何讓CDATA Content加載webView。
請幫幫我, 謝謝, Madan Mohan。