RaptureXML iterate:usingBlock warning and crash

systemonster

New Member
I'm parsing an XML file which looks like this:\[code\]<partie numero="1"> <exercice numero="1" libelle="blabla"></exercice> <exercice numero="2" libelle="anything"></exercice></partie>\[/code\]I'm using the Rapture XML Library, so as explained on GitHub, I do the following :\[code\]RXMLElement *rxmlPartie = [rxmlParties child:@"partie"];NSArray *rxmlUnExercice = [rxmlPartie children:@"exercice"];\[/code\]I can print correctly the "numero" attribute from partie with this line :\[code\] NSLog(@"Partie #%@",[rxmlPartie attribute:@"numero"] );\[/code\]But when I try to use the iterate method on my NSArray :\[code\][rxmlPartie iterate:@"partie.exercice" usingBlock: ^(RXMLElement *exercice) {NSLog(@"Exercice: %@ (#%@)", [exercice attribute:@"libelle"], [exercice attribute:@"numero"]);}];\[/code\]I get a warning, and the the application crash, saying :\[code\]-[RXMLElement iterate:usingBlock:]: unrecognized selector sent to instance 0xc67f870Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '- [RXMLElement iterate:usingBlock:]: unrecognized selector sent to instance 0xc67f870'\[/code\]Did I forget to import something, or do I implement the method in a bad way?The same error happens if i try to use iterateWithRootXPath...Thanks for your help!!
 
Back
Top