Ios 在webView中显示可变字符串
我有一个可变字符串作为程序的输出,我需要在Ios 在webView中显示可变字符串,ios,ios6,Ios,Ios6,我有一个可变字符串作为程序的输出,我需要在UIWebView中显示它们 WebView中是否有可用的方法来显示字符串或可变字符串 可变字符串的代码: // interface @property (nonatomic, readwrite) NSMutableString *theString; //the string NSMutableString *string = [feeds[indexPath.row] objectForKey: @"link"]; NS
UIWebView
中显示它们
WebView
中是否有可用的方法来显示字符串或可变字符串
可变字符串的代码:
// 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:@“%@/”,yourMutableString];
[webView加载htmlString:htmlString基URL:nil];
我需要在WebView中显示“字符串”,我该怎么做?您必须按照我上面的回答加载它。它不起作用吗?
NSString *htmlString = [NSString stringWithFormat:@"<html><head></head><body>%@/</body></html>", yourMutableString];
[webView loadHTMLString:htmlString baseURL:nil];