Loading time in iphone application
in my application i make some a开发者_StackOverflowvtivity like download a file of 500 KB, parsing a XML file with 1900 nodes. I think it's better print on screen a loading indicator, what do you think? Are these long operations on iphone? Is a good practice insert always a loading indicator?
Yeah you must show a loading indicator other wise your app looks like an hanged one. Apple's HIG suggest the same.
Absolutely. This is one of those fundamental guidelines for writing usable applications - always be responsive, and when you are busy doing something, have a clear method of indicating this to the user. Users need to know your application is doing something, not questioning whether it has hung or crashed.
In your case, the downloading and processing of the XML should happen in a background thread, which periodically notifies the GUI as to its overall progress. The more accurate this progress estimate, the better (i.e. KB downloaded so far vs total file size and in the next step, nodes parsed). Even better if you can provide a means of canceling the action, if the user cannot wait any longer and needs to do something else.
精彩评论