【发布时间】:2010-06-24 12:29:59
【问题描述】:
我正在创建一个简单的 FeedReader iPhone 应用程序,其中 RSS 是使用 NSXMLParser 解析的提要。解析 RSS 的代码是类似于here 所示的标准代码。
但我注意到每个解析的元素末尾都有 '\n\t\t' 字符。 例如。
link = "http://bakery.cakephp.org/articles/view/exporting-data-to-csv-the-cakephp-way\n\t\t\t";
date = "Fri, 23 Apr 2010 10:02:55 -0500\n\t\t\t";
因此,我无法使用该链接将其提供给 NSWebView,并且它包含非法字符。即使我使用类似
NSString *storyURL = [NSString stringWithFormat:@"%@", self.selectedURL];
NSString *webURL = [storyURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
网址无效。例如。
http://bakery.cakephp.org/articles/view/creating-pdf-files-with-cakephp-and-tcpdf%0A%09%09%09
这显然会产生 404 错误。
有什么方法可以去掉每个解析字符串末尾的多余字符?
谢谢。
【问题讨论】:
标签: iphone nsxmlparser