I'm having XML in my Web-Service in following format.
<xml>
<Menu>
<pair>
<MenuCategory shortname="Starters Menu" description_en="hgfhghgh" image="Small.jpg" description_fr="" description_ge="" description_it="" description_sp="" description_ch="">
<MenuItems>
<menuItem price="666" image="060649XSmall.jpg" shortname="kandan" description_en="kandan" description_fr="" description_ge="" description_it="" description_sp="" description_ch=""/>
<menuItem price="250" image="3.jpg" shortname="Vegetable Soups" description_en="Vegetable Soups" description_fr="" description_ge="" description_it="" description_sp="" description_ch=""/>
<menuItem price="52" image="3.jpg" shortname="Mixed Starters" description_en="Mixed Starters" description_fr="" description_ge="" description_it="" description_sp="" description_ch=""/>
<menuItem price="45" image="14.jpg" shortname="Pumpkin soup" description_en="Pumpkin soup" description_fr="" description_ge="" description_it="" description_sp="" description_ch=""/>
<menuItem price="15" image="15.jpg" shortname="Almondrolledgoatsche" description_en="Almondrolledgoatsche" description_fr="" description_ge="" description_it="" description_sp="" description_ch=""/>
</MenuItems>
</MenuCategory>
</pair>
</Menu>
</xml>
I've tried to parse this XML from my webservice using TBXML. But, not yet get my output,
TBXML *XML = [[TBXML alloc]initWithURL:[NSURL URLWithString:urlString]];
TBXMLElement *rootXML = XML.rootXMLElement;
TBXMLElement *e = [TBXML childElementNamed:@"MenuItems" parentElement:rootXML];
NSString *woeid = [TBXML textForElement:e->firstChild];
NSLog(@"Woeid - %@", woeid);
It throws EXEC_BAD_ACCESS error simply. I just required to parse this xml to my NSMutableArray There are lot of examples related to this. But, don't know which one is suitable for my requirement. Has anyone worked in this format? Any idea that how to achieve that?