在webView中显示可变字符串
问题描述:
我有一个可变字符串作为我的程序的输出,我需要在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];
答
NSString *htmlString = [NSString stringWithFormat:@"<html><head></head><body>%@/</body></html>", yourMutableString];
[webView loadHTMLString:htmlString baseURL:nil];
我需要显示的WebView的 “theString”,我该怎么做呢? – Siva
您必须按照上面的回答来加载它。它不工作? –