haawa
haawa

Reputation: 3104

How to get NSString that xml from the url contain?

I know how to parse NSString object with DOM parser, but i have no idea how to get that NSString from xml file on web.

Any information would be helpful.

Upvotes: 1

Views: 653

Answers (1)

Anne
Anne

Reputation: 27073

Create NSString based on online .xml file:

NSURL *theURL = [NSURL URLWithString:@"http://www.website.com/feed.xml"];
NSError *error = nil;
NSString *theXML = [NSString stringWithContentsOfURL:theURL encoding:NSUTF8StringEncoding error:&error];

Upvotes: 2

Related Questions