How to get items from feed in iphone? - iphone

iam developing RSS Reader, i need to get the items from the given Feed URL.I used Touch XML for this, but this is very slow.Is there any faster way? thanks.

NSXMLParser is the raw XML parser

Related

XML generation from data in core data iphone

I am going to make an application and in that I want to store user's input in XML file and then parse it to another user,So I am confuse How can I do it, and which XML method should I use? NSXML parser,libxml,touchXML or KissXML?
I think this link will help you to choose best type of xml parser.
How To Choose The Best XML Parser for Your iPhone Project
Thank You

Iphone parsing large Xml documents

I just implemented my first XmlParser object (MyParserObj) that relies on the NSXMLParser object.
This parser is embedded inside a tableviewController (MyTableViewController) and it starts parsing at MyTableViewController's viewDidLoad method.
Ok.This is working just fine.It's a small Xml file though! I was wondering if I should choose a different approach when dealing with big Xml files? Will memory suffer when parsing large xml documents?
UPDATE
The real point I want to understand is the flow of the process:
I placed few breakpoints now and it looks like this:
the app first encounters ( inside MyTableViewController's viewDidLoad method )the [MyParserObj parseXMLFileAtURL:path] and starts parsing the Xml document;
The app finishes parsing the whole Xml Document (parserDidEndDocument..);
The tableviewController starts populating its tableView Cells (cellForRowAtIndexPath..);
Apart from choosing a XmlParser (Between those you suggested) that is more or less time/memory consuming are the above steps going to be the same?
If positive, is it correct to think of starting populating the cells as soon as The Parser is done with that specific element?How do I do that?
thanks
Luca
Jim Dovey create a nice blog post about parsing big XML files.
http://blog.alanquatermain.me/2009/04/06/aqxmlparser-equals-equals-big-memory-win/ here Jim describes his one XML parser wich user les memory then other parser.
So if you need to parse large XML files I would suggest you have a look het the open source XML parser AQXMLParser which is the parser create in the blog post.
On iPhone devices, you don't have the NSXMLDocument available on MAC which reads the whole XML document into memory. There are many XML Parser classes available, and you can find them in the link below.
http://www.raywenderlich.com/553/how-to-chose-the-best-xml-parser-for-your-iphone-project
This tutorial on Ray Wenderlich is what u need to read to know which xml reader is best for your app.
For my own applications, I use SMXMLDocument, you can read about it here:
http://nfarina.com/post/2843708636/a-lightweight-xml-parser-for-ios
for big data, i suggest u json instead of xml, see here a tutorial
http://www.readwriteweb.com/hack/2010/11/json-vs-xml.php

Displaying content from an RSS feed in an iphone app

I have seen some tutorials on the subject, but they all go half into it and then leave a person wondering.
How can I stream an rss feed into an iphone app.
I know the xml should be read in, parsed etc.
But then I am not sure how to display the information I need like, images, embedded videos etc.
If someone could just point me in the right direction I would be extremely grateful.
Thanks in advance
First, you need some type of XML parser. You can use the built in NSXMLParser or a slew of other parsers that you will need to download. Each have their pros/cons depending on what type of reading/writing you will be doing with your RSS feed.
To display the data, I would recommend a tableView. You can create custom UITablvewCells for each cell to hold the data however you want to display it. There are several tutorials available for that if you want to Google for it.
As for data, read all the RSS data into an array you create and have the tableView access that array.
Again, there are many online tutorials for this already but it seems like you need help with displaying the data. A quick Google lookup for how to create custom UITableViewCells should provide you lots of helpful links. Good luck.

iPhone: How to populate a table view from XML data?

Let's say I have XML data that I just downloaded from a web app api.
How do I parse the data?
How do I populate each cell of a table view with this data?
Here is a tutorial that does exactly what you are asking for. It downloads an RSS feed (which is XML), parses it, then loads the data into a table.
It should be easy to modify this for your application.
http://theappleblog.com/2008/08/04/tutorial-build-a-simple-rss-reader-for-iphone/
try using NSXMLParser. You can get the documentationhere

iPhone: random "image of the day" type service?

The iPhone makes it really simple to snarf down an image from the web; you can turn a URL into a UIImage in one line of code. So I'd like to enable my app (an educational puzzle game... my first!) to download some random images to make it more interesting and dynamic.
I thought about using Kodak's image of the day RSS feed, but I'm having quite a time figuring out how to parse it. Rather than being a simple list of image URLs, it seems to reference a bunch of "jhtml" URLs, which run Javascript to display the images in your RSS reader. Is this intentionally obfuscated, or am I missing some basic step to parse this?
I also tried the Astronomy Picture of the Day, via this RSS feed, but it's just the original page's HTML stuffed into CDATA... ugh.
So I guess this is really two questions:
Is there a simple way to parse these feeds to actually get at the JPG URLs on the iPhone?
Is there a better source for "picture of the day" type images?
PS: I'm using NSXMLParser, which I learned to use here.
I would recommend going with something that has an API, perhaps the Flickr "Interestingness" feed:
http://www.flickr.com/services/api/flickr.interestingness.getList.html
There is an objective-C library written to help with accessing Flickr but not sure if this API call is included:
http://github.com/lukhnos/objectiveflickr/tree/master