什么是解析RSS的最佳方式/ Atom提要一个iPhone应用程序? [英] What's the best way to parse RSS/Atom feeds for an iPhone application?

查看:195
本文介绍了什么是解析RSS的最佳方式/ Atom提要一个iPhone应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我的理解是有可用的几个选项就解析XML直老话:的NSXMLParser,TouchXML从触摸code,等等。这是所有罚款,并似乎为我工作得很好。

So I understand that there are a few options available as far as parsing straight XML goes: NSXMLParser, TouchXML from TouchCode, etc. That's all fine, and seems to work fine for me.

在这里真正的问题是,有几十个RSS源(和Atom提要太)的小变化,因此可支持饲料的所有可能的排列在互联网上变得非常难以管理。我搜索周围,将处理所有这些低层次的细节对我来说是图书馆,但就出来了没有任何东西。

The real problem here is that there are dozens of small variations in RSS feeds (and Atom feeds too), so supporting all possible permutations of feeds available out on the Internet gets very difficult to manage. I searched around for a library that would handle all of these low-level details for me, but came out without anything.

由于人们可以在Objective-C链接到外部C / C ++库,我想知道是否有一个图书馆,在那里,将是最适合这个任务吗?必须有人已经创建了这样的事情,它只是很难找到在谷歌对从数以千计的结果选项。

Since one could link to an external C/C++ library in Objective-C, I was wondering if there is a library out there that would be best suited for this task? Someone must have already created something like this, it's just difficult to find the "right" option from the thousands of results in Google.

不管怎样,有什么解析RSS的最佳方式/ ATOM在一个iPhone应用程序供稿?

Anyway, what's the best way to parse RSS/Atom feeds in an iPhone application?

推荐答案

最佳是相对的。最佳的性能,你需要走SAX的路线和实施处理。我不知道任何东西在那里开源可用(启动谷歌code项目,并释放它为我们其余的使用!)

"Best" is relative. The best performance you'll need to go the SAX route and implement the handlers. I don't know of anything out there open source available (start a google code project and release it for the rest of us to use!)

不管你做什么,它可能是一个非常糟糕的主意,试图整个XML文件加载到内存中,并作用于它像一个DOM。有可能到头来你会得到的远远大于你可以导致频繁的内存警告和崩溃的设备上处理的饲料。

Whatever you do, it's probably a really bad idea to try and load the whole XML file into memory and act on it like a DOM. Chances are you'll get feeds that are much larger than you can handle on the device leading to frequent memory warnings and crashes.

这篇关于什么是解析RSS的最佳方式/ Atom提要一个iPhone应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆