views:

146

answers:

2

Since Days i'm trying to parse a YOUTUBE-XML-Feed by using GDATA-API for iOS.

http://code.google.com/intl/de-DE/apis/youtube/2.0/developers_guide_protocol_channel_search.html

   NSDictionary *namespaces = [NSDictionary dictionaryWithObjectsAndKeys:
        @"http://www.w3.org/2005/Atom", @"",
        @"http://schemas.google.com/g/2005", @"gd",
        @"http://a9.com/-/spec/opensearch/1.1/",@"opensearch",
        @"http://gdata.youtube.com/schemas/2007",@"yt",
        @"W/"DkYGRH48fCp7ImA9Wx5WFEw."",@"gd:etag",
        nil];

 NSError *error = [[NSError alloc] init];
GDataXMLDocument *doc = [[GDataXMLDocument alloc] initWithData:receivedData options:0 error:nil];

 NSArray *elements = [doc nodesForXPath:@"//entry" namespaces:namespaces error:&error];

I don't get any results. Does anyone got an solution to this? Thanks in advance!

A: 

this is how I use this API

NSArray *entries = [doc.rootElement elementsForName:@"entry"];
for (GDataXMLElement *e in entries) {
// do something..
}
Aaron Saunders
A: 

There is documentation on the GData Objective-C API, and a sample application for using the YouTube GData API is here.

grobbins