Where should I initialize my data?

I am parsing a CSV file when an iphone app is loaded. It will take a few seconds, I would like to trigger the popup while this is happening because I am loading this data from wakeFromNib, after I am done, the splash screen appears.

So where am I supposed to do this job?

+2


a source to share


3 answers


How about uploading CSV to applicationDidFinishLaunching:

on UIApplicationDelegate

?



+2


a source


As with most tasks that block the UI, run it on a background thread and tell the main thread (to hide the splash screen) when it's done.



0


a source


I highly recommend NSOperation for this kind of task. Google for some tutorials .

applicationDidFinishLaunching (app-wise) or viewDidLoad (ViewController-wise) is a good place to put your code.

0


a source







All Articles