Parsing a local xml file in iOS sdk Parsing a local xml file in iOS sdk ios ios

Parsing a local xml file in iOS sdk


I assume from your tags that you're using NSXMLParser to parse the XML. In that case, you can do this:

NSString *xmlPath = [[NSBundle mainBundle] pathForResource:@"MyFile" ofType:@"xml"];NSData *xmlData = [NSData dataWithContentsOfFile:xmlPath];NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData:xmlData];// do whatever you want with xmlParser


matomo