Parsing XML Storing into NSArray

Saltarersaw

New Member
I am attempting to parse an XML and store the URL from one element of the XML into an NSArray. Here is my code so far:\[code\] NSURL *url = [NSURL URLWithString:@"http://www.316apps.com/LakesideDocs/podcasttrial.xml"]; NSData *xmlData = http://stackoverflow.com/questions/10726793/[[NSMutableData alloc] initWithContentsOfURL:url]; NSError *error; GDataXMLDocument *doc = [[GDataXMLDocument alloc] initWithData:xmlData options:0 error:&error]; NSArray *channels = [doc.rootElement elementsForName:@"channel"]; for (GDataXMLElement *channel in channels) { NSArray *items = [channel elementsForName:@"item"]; for (GDataXMLElement *item in items) { NSString *articlePoint = [item valueForChild:@"link"]; NSArray *linkarray = [[NSArray alloc] initWithObjects:articlePoint, nil]; NSLog(@"%@", linkarray); } }\[/code\]For the NSLog I would expect:\[code\]TabBarSample[40191:fb03] ( ( "http://domain.com/image1.jpg" ),("http://domain.com/image2.jpg"))\[/code\]But I get:\[code\]TabBarSample[40191:fb03] ("http://domain.com/image1.jpg")TabBarSample[40191:fb03] ("http://domain.com/image2.jpg")\[/code\]What am I doing wrong?
 
Back
Top