I'm really need help with parsing XML by TBXML. I created a demo project with a view has a button,when users press this button, I just call TBXML parsing function from another class. Im doing this to test my TBXMLParsing function works correctly or not. And it works pretty well in my demo project.
Finally, after I tested it, I copy and paste the function into my real project which has a button in first view, when I click on that button then it calls TBXMLParsing function. In other words, it is basically same as demo project. However, TBXMLParsing function doesn't work. It cant traverse thru all elements.
Do you have any ideas? Thanks for helping me.
Update: It is working if I simulate my app on real device, but it does not traverse thru the XML if I simulate it on simulator. It is so weird. However it does work on simulator if I create new project. Thus, there must be something that in my app that prevent parser XML.
Any ideas? Thank you
Update2:
NSData *data = [[NSData alloc]initWithContentsOfURL:[NSURL URLWithString:@"http://dl.dropbox.com/u/37064335/ex.xml"]];
TBXML *tbxml = [[TBXML alloc] initWithXMLData:data];
[data release];
TBXMLElement *root = tbxml.rootXMLElement;
// if root element is valid
if (root) {
NSLog(@"root =%s",root->name);
This is the part messed me up. I tested in demo app, Nslog root=GetUserAccountsRespond However in my app Nslog root= (nil-nothing printed out). Both projects are basically the same.