2012-08-13 12 views
0

Je chargeais html sur le site en utilisant comme suitHtml ne se charge pas dans UIWebView

 -(void)connectionDidFinishLoading:(NSURLConnection *)connection{ 
//CategoriesParser *parser=[[CategoriesParser alloc]init]; 
//[parser setDelegate:self]; 
//[parser startParsing:xmlData]; 

NSString *[email protected]"<html><head></head><body>"; 

NSString* newStr = [[[NSString alloc] initWithData:urlData 

              encoding:NSUTF8StringEncoding] autorelease]; 

newStr=[NSString stringWithFormat:@"<html><head></head><body>%@</body></html>",newStr]; 


[webView loadHTMLString:newStr baseURL:nil]; 

}

, mais malheureusement, il montre le code html sur WebView comme

<p style="text-align: justify;"><span style="font-family: helvetica; font-size: small;">The UAE manages what some Arab cities fail to achieve; 

etc

Alors s'il vous plaît aider ce que je fais mal en chargeant la chaîne html dans le webview
+0

ce qui est urlData? – Jessedc

+0

pouvez-vous enregistrer la chaîne html ..? – vishy

+0

Qu'est-ce que les données d'URL ... – Rajneesh071

Répondre

0

Essayez ceci, cela fonctionne pour moi

-(void)loadHTML{ 

NSMutableString *html = [NSString stringWithFormat:@"<html><head></head><body>%@</body></html>",@"Hi"]; 
[self.tpWebView loadHTMLString:html baseURL:nil]; 

}