-1

我有一个可变字符串作为程序的输出,我需要将它们显示在UIWebView.

是否有任何可用的方法WebView来显示字符串或可变字符串

可变字符串的代码:

// interface


@property (nonatomic, readwrite) NSMutableString *theString;


//the string

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

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

    [[segue destinationViewController] setTheString:string];
4

1 回答 1

4
NSString *htmlString = [NSString stringWithFormat:@"<html><head></head><body>%@/</body></html>", yourMutableString];  
[webView loadHTMLString:htmlString baseURL:nil];
于 2013-07-24T13:11:52.233 回答