What's the best way to parse RSS/Atom feeds for an iPhone application?

前端 未结 10 1318
感动是毒
感动是毒 2020-12-24 14:43

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 fi

相关标签:
10条回答
  • 2020-12-24 15:23

    I'm currently trying out the MWFeedParser @Michael Waterfall is developing.

    Quite easy to set up and use (I'm a beginner iPhone developer).

    His sample code for using MWFeedParser to populate a UITableViewController implementation is helpful as well.

    0 讨论(0)
  • 2020-12-24 15:25

    This might be a reasonable starting point for you. Atom support isn't there yet, but you could help out?

    0 讨论(0)
  • 2020-12-24 15:27

    "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!)

    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.

    0 讨论(0)
  • 2020-12-24 15:35

    Check out my library for parsing Atom feeds, (BSAtomParser) at GitHub. It doesn't care about validating the feed, it does its best at returning whatever is valid. The parser covers most of RFC 4287, even extensions.

    0 讨论(0)
  • 2020-12-24 15:35

    Actually, I was trying to suggest you ask on the TouchCode discussion board, because I remember someone was trying to expand it to support RSS. That might be a decent starting point. But I was being rushed by my wife.

    But I see now that TouchCode doesn't have a discussion board. I'd still ask the author, though, he might know what came of that effort.

    0 讨论(0)
  • 2020-12-24 15:36

    I've just released an open source RSS/Atom Parser for iPhone and hopefully it might be of some use.

    I'd love to hear your thoughts on it too!

    0 讨论(0)
提交回复
热议问题