Ios 如何从NSDictionary中的HTML字符串显示UIWebview?

Ios 如何从NSDictionary中的HTML字符串显示UIWebview?,ios,objective-c,json,uiwebview,Ios,Objective C,Json,Uiwebview,我目前正在使用JSON来使用web服务。。以下是JSON: [ { id: 4, title: "post1", permalink: “http://www.example.com/test-post”, content: “<html> >text here< <iframe src="//player.vimeo.com/video/1010101?title=0&amp;byline=0&amp;portrait=0&amp;colo

我目前正在使用JSON来使用web服务。。以下是JSON:

[
{
id: 4,
title: "post1",
permalink: “http://www.example.com/test-post”,
content: “<html> >text here< <iframe src="//player.vimeo.com/video/1010101?title=0&amp;byline=0&amp;portrait=0&amp;color=ff5546" height="638" width="850" allowfullscreen="" frameborder="0"></iframe> <a href="http://example.com/wp-content/uploads/2014/01/testpic.png"><img class="aligncenter size-full wp-image-1180" alt="testpic" src="http://example.co/wp-content/uploads/2014/02/testpic.png" width="850" height="611" /></a>",
excerpt: " blah blah blah",
date: "2014-02-24 23:38:19",
author: "admin",
categories: 
[
"Uncategorized"
],
tags: [ ]
},
{
id: 1,
title: "Hello world!",
permalink: “http://www.example.com/test-post”,
content: "Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!",
excerpt: "Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!",
date: "2014-02-24 22:46:12",
author: "admin",
categories: 
[
"Uncategorized"
],
tags: [ ]
}
]
我试过这样的方法:

NSString *myHTML = [NSString stringWithFormat:@"%@", _jsonData];
[webView loadHTMLString:myHTML baseURL:nil];
但我总是犯这样的错误:

'[<ThirdViewController 0x8a265a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key storyboard.'
“[setValue:forUndefinedKey:]:此类不符合关键情节提要的键值编码。”
我一整天都在想办法


有什么建议吗?

首先,如果您看这里,我认为您的错误与webView无关:

这家伙在story bord也有同样的问题

第二,我通常用来显示html上下文的是“RTLabel”类,非常容易使用!而且效果很好

您只需导入: #导入“RTLabel.h”

并像这样使用它:

          finalTakeTrhee = [NSString stringWithFormat:@"<font face='Helvetica-Light' size=15   color='black'>%@</font> ",finalTwo];
      }


    RTLabel *label = [[RTLabel alloc] initWithFrame:CGRectMake(90, 3, 236, 70)];
    label.tag = MY_CUSTOM_TAG;
    label.lineSpacing = -1;
    label.textAlignment = NSTextAlignmentLeft;

    [cell.contentView addSubview:label] ;

    //  [cell.contentView addSubview:label];
    [label setText:finalTakeTrhee];
finalTakeTrhee=[nsstringwithformat:@“%@”,finalTwo];
}
RTLabel*label=[[RTLabel alloc]initWithFrame:CGRectMake(90,3236,70)];
label.tag=我的自定义标签;
label.linespace=-1;
label.textAlignment=NSTextAlignmentLeft;
[cell.contentView addSubview:label];
//[cell.contentView addSubview:label];
[标签设置文字:finalTakeTrhee];
希望这有帮助

          finalTakeTrhee = [NSString stringWithFormat:@"<font face='Helvetica-Light' size=15   color='black'>%@</font> ",finalTwo];
      }


    RTLabel *label = [[RTLabel alloc] initWithFrame:CGRectMake(90, 3, 236, 70)];
    label.tag = MY_CUSTOM_TAG;
    label.lineSpacing = -1;
    label.textAlignment = NSTextAlignmentLeft;

    [cell.contentView addSubview:label] ;

    //  [cell.contentView addSubview:label];
    [label setText:finalTakeTrhee];