I’ve got an interesting problem.
I have an iPad App which has to parse some XML-Data from the Web and it all works fine in 5.0 Simulator and Device but on iOS 4.3 Simulator (actually i don’t have any 4.3 Device available) it won’t parse and the [NSXMLParser parse] method retuns NO
I already tried downloading the string first then converting it to NSData, aswell as Dowloading the NSData directly and initialize the parser with the downloaded NSData.
Here’s my Code
-(void)parseWithURLString:(NSString *)urlString{
NSURL *url = [NSURL URLWithString:urlString];
if (url != nil) {
self.parser = [[NSXMLParser alloc] initWithContentsOfURL:url];
[[self parser] setDelegate:self];
if([[self parser] parse]){
NSLog(@"WOOHOO!");
[TestFlight passCheckpoint:@"XML has been parsed"];
}
}
The urlString has been checked and is correct.
Log the
parseErrorproperty of yourNSXMLParser. That should lead you to know what exactly is your problem.Alternatively, you can implement the following protocol and log the error that occurs during parsing: