I parse a XML file, and after parsing get a NSDictionary object (XMLDictionary named). I\'m parsing this:
27
NSError* parseError = nil;
_xmlDictionary = [XMLReader dictionaryForXMLString:myXMLString error:&parseError];
if (parseError != nil) {
NSLog(@"Error on XML parse: %@", parseError);
}
NSLog(@"The full dictionary is %@", _xmlDictionary);
NSDictionary* result = [_xmlDictionary objectForKey:@"result"];
NSLog(@"'result' = %@", result);
NSDictionary* node = [result objectForKey:@"node"];
NSLog(@"'node' = %@", node);
NSString* name = [node objectForKey:@"name"];
NSLog(@"'name' = %@", name);
At the very least, if it fails, the error will be isolated to a single operation. And the NSLogs will show you the values after each step.