Search code examples
iphoneiosxmlgdata

How can i get xml data from an URL using GDataXML parser in iPhone application development?


I just want to know that how can I use url in GDataXML parser for extracting xml data. I have never used it before so please anybody help me.


Solution

  • You asked a non-descriptive question, so there's not much I can do to explain what you need help with.

    NSData *data = [[NSMutableData alloc] initWithContentsOfURL:someURL];
    NSError *error;
    GDataXMLDocument *doc = [[GDataXMLDocument alloc] initWithData:data 
        options:0 error:&error]; 
    NSLog(@"%@", doc.rootElement);
    

    Take a look at the (numerous) tutorials on the 'net, such as this one.