PDA

View Full Version : feed vs http




joshsroka
Nov 12, 2008, 10:07 AM
why can i have my program parxe the xml of a http:// feed but it gives an error if i try a feed://, the difference is that after i parse the http clicking the heading takes to to another page, but if i look at the feed:// then clicking the heading plays the track. I am working on a simple program for my church members to stream sermons, it is in the itunes store now but it is a 2 click process, 1 to choose the sermon, which then opens safari where you have to click the link to start the stream. Any tips? thanks, you can search Broadneck EP Sermons to find my app in the store. Thanks again



jnic
Nov 12, 2008, 10:14 AM
why can i have my program parxe the xml of a http:// feed but it gives an error if i try a feed://

What method are you using to download the XML? AFAIK, initWithContentsOfURL and related methods do not support the feed:// URL scheme.

joshsroka
Nov 12, 2008, 10:30 AM
I am using initWithContentsOfURL any suggestions for a different way of doing it? or do you know of a podcast host that lets you click on the title and it starts streaming rather then going to a info page? thanks

jnic
Nov 12, 2008, 10:44 AM
If the XML contains the link to the streaming media then you could try parsing it out in your code and passing that directly to Safari.

Alternatively, if it's something fairly standard you could try playing it directly within the app. See this thread for more info: http://forums.macrumors.com/showthread.php?p=6595767#post6595767

joshsroka
Nov 12, 2008, 08:42 PM
ok so how would i parse the links? If you have used the diggnation on the go app that is basically what i am trying to do for my app. thanks again

jnic
Nov 13, 2008, 04:17 AM
ok so how would i parse the links? If you have used the diggnation on the go app that is basically what i am trying to do for my app. thanks again

Assuming you're getting XML, check out NSXMLParser (http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Classes/NSXMLParser_Class/Reference/Reference.html).

The SeismicXML code sample (https://developer.apple.com/iphone/library/samplecode/SeismicXML/index.html) shows how it's implemented. (In particular, take a look at XMLReader.m.)

Alternatively, here's a nice tutorial on the same theme: http://theappleblog.com/2008/08/04/tutorial-build-a-simple-rss-reader-for-iphone/