Hey everbody, I'm getting some trouble with TBXML and While. I'm trying to parse a couple of nodes of XML. My XML is this:
<teste>
1 2 3
But when I set while, my app just crashes.
itemsList = [[NSMutableArray alloc] init];
TBXML * tbxml = [[TBXML tbxmlWithURL:[NSURL URLWithString:@"http://localhost/dev/http/test.xml"]] retain];
TBXMLElement * rootXMLElement = tbxml.rootXMLElement;
TBXMLElement * comentarios = [TBXML childElementNamed:@"comentarios" parentElement:rootXMLElement];
while (comentarios != nil) {
TBXMLElement * comentario = [TBXML childElementNamed:@"comentario" parentElement:comentarios];
NSString * descText = [TBXML textForElement:comentario];
[itemsList addObject:descText];
}
What im doing wrong?