美文网首页
webView加载HTML页面

webView加载HTML页面

作者: DeadRoach | 来源:发表于2016-07-12 15:01 被阅读37次


NSDictionary * dic = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];

NSDictionary * lastDic = dic[@"data"];

NSString * contentPath = lastDic[@"wap_content"];

//NSLog(@"%@",contentPath);

//如果不能直接获取数据 需要转码后才可使用

//NSString * webPath = [contentPath stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

[self.MyWebView loadHTMLString:[NSString stringWithFormat:@"<body>%@</body>",contentPath] baseURL:[NSURL URLWithString:contentPath]];

相关文章

网友评论

      本文标题:webView加载HTML页面

      本文链接:https://www.haomeiwen.com/subject/ovkjjttx.html