I use TBXML to download a .xml file from the web. I parse the file correctly and I get all the data I want as I want it.
My problem is that I updated the file on the server, and it did not update in the app. It only updated the file when I deleted and reinstalled the app.
Is there some kind of cache or something ?
This is how I order the fetch :
-(void)getXML {
NSLog(@"Updating ATC data !");
// Create a success block to be called when the async request completes
TBXMLSuccessBlock successBlock = ^(TBXML *tbxmlDocument) {
// If TBXML found a root node, process element and iterate all children
if (tbxmlDocument.rootXMLElement)
[self traverseElement:tbxmlDocument.rootXMLElement];
};
// Create a failure block that gets called if something goes wrong
TBXMLFailureBlock failureBlock = ^(TBXML *tbxmlDocument, NSError * error) {
NSLog(@"Error! %@ %@", [error localizedDescription], [error userInfo]);
};
// Initialize TBXML with the URL of an XML doc. TBXML asynchronously loads and parses the file.
TBXML *tbxml = [[TBXML alloc] initWithURL: [NSURL URLWithString:@"http://www.mysite.com/myFile.xml"]
success: successBlock
failure: failureBlock];
}
And this is how I call it in background:
[self performSelectorInBackground:@selector(getXML) withObject:Nil];
It may be useless to call it in background as TBXML works asynchronously, if someone can confirm that I'll take it away. Also, I don't think the code of my traverseElement:
method is useful here, because the file is parsed correctly.
Thanks for any help here !
Seems like the problem vanished.. It works fine, but I have no idea why it didn't work in the first place.