2013-07-24 81 views
-1

我有一個可變字符串作爲我的程序的輸出,我需要在UIWebView中顯示它們。在webView中顯示可變字符串

WebView有什麼可用的方法來顯示字符串或可變字符串

MutableString的代碼:

// interface 


@property (nonatomic, readwrite) NSMutableString *theString; 


//the string 

    NSMutableString *string = [feeds[indexPath.row] objectForKey: @"link"]; 

    NSLog(@"Description : %@" , string); 

    [[segue destinationViewController] setTheString:string]; 

回答

4
NSString *htmlString = [NSString stringWithFormat:@"<html><head></head><body>%@/</body></html>", yourMutableString]; 
[webView loadHTMLString:htmlString baseURL:nil]; 
+0

我需要顯示的WebView的 「theString」,我該怎麼做呢? – Siva

+2

您必須按照上面的回答來加載它。它不工作? –