Hi,
I'm working on an app, which parses some XML files to build up an database.
Originally, I was presenting a popup to the user telling him that the db needed to be built. Once he clicked YES; the XML files would get loaded, and the database constructed...
I originally used: NSXMLParser; sadly, the XML files I'm using aren't perfect and NSXMLParser bailed out before completing the parsing... stupidly without having an "ignore this error" option... I switched to TBXML.
Everything worked, except that it takes about 5 minutes to download and parse all XML files (about 200).
I refactored it to download the XML in the background; and once the file is downloaded into NSData objects; I initialize the TBXML and do the parsing...
Now I'm facing two issues:
1 - everytime a download is achieved the app will freeze for couple of seconds.
2 - if the freeze time is too long, the app will just automatically quit (thinking it's crashed...)
Beside creating another thread to do the XML parsing/database populating...
Does anyone has any advices? Such as: better XML library to use, or a way to divide the work using event or notification...?
I'm working on an app, which parses some XML files to build up an database.
Originally, I was presenting a popup to the user telling him that the db needed to be built. Once he clicked YES; the XML files would get loaded, and the database constructed...
I originally used: NSXMLParser; sadly, the XML files I'm using aren't perfect and NSXMLParser bailed out before completing the parsing... stupidly without having an "ignore this error" option... I switched to TBXML.
Everything worked, except that it takes about 5 minutes to download and parse all XML files (about 200).
I refactored it to download the XML in the background; and once the file is downloaded into NSData objects; I initialize the TBXML and do the parsing...
Now I'm facing two issues:
1 - everytime a download is achieved the app will freeze for couple of seconds.
2 - if the freeze time is too long, the app will just automatically quit (thinking it's crashed...)
Beside creating another thread to do the XML parsing/database populating...
Does anyone has any advices? Such as: better XML library to use, or a way to divide the work using event or notification...?