我正试图为wordpress博客创建一个小应用程序。为此,我想我将创建一个webservice,它将mysql表的post_title和post_content转换为json对象,然后对请求使用AFNetworking。
问题是,post_content是一个html字符串,如下所示:
Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!
<a href="http://URL/wordpress/wp-content/uploads/2014/04/Digital-Board-2.png"><img class="alignnone size-full wp-image-5" src="http://URL/wordpress/wp-content/uploads/2014/04/Digital-Board-2.png" alt="Digital Board 2" width="1024" height="704" /></a>我尝试过将它放入UIWebView中,但这可能不适合,因为图片比屏幕大得多。
我想知道怎样才是正确的方法,这样我就可以正确地定制文本和图像。
我在想,你能不能把所有的东西都放进一个数组里,然后用url或者别的什么来分割。所以看起来是这样的:
Array = [Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!], [http://URL/wordpress/wp-content/uploads/2014/04/Digital-Board-2.png]这个是可能的吗?如果是的话,我该怎么做?
我有更好的方法。
发布于 2014-04-19 11:07:46
如果您想查看这样的博客内容,可以使用DTCoreText。但是,如果您需要更多的自由,在设计,看看DTFoundation。框架DTFoundation有一个HTMLParser,您的工作量减少了很多。
https://stackoverflow.com/questions/23168482
复制相似问题