-2

In my XML,i need to find the element tag whether it exists or not using TBXML

BenMorel
  • 34,448
  • 50
  • 182
  • 322
wesley
  • 859
  • 5
  • 15

1 Answers1

3

enter code hereYou will check if element is non nill than it exists.. as

TBXMLElement *rootElement = [xml rootXMLElement];

TBXMLElement *yourTag = [TBXML childElementNamed:@"YourTagName" parentElement:rootElement];
if(yourTag)
   NSLog(@"This element exists");
else
   NSLog(@"This element does not exist");
Janak Nirmal
  • 22,706
  • 18
  • 63
  • 99