views:

55

answers:

3

I am parsing a CSV file when my iphone app loads. This takes a few seconds I would like to throw up a splash screen while this is happening however because I am loading this data from wakeFromNib the splash screen is coming up after I am done.

So where should I do this work?

+2  A: 

What about loading the CSV in applicationDidFinishLaunching: on UIApplicationDelegate?

Tom Dalling
A: 

As with most tasks that block the UI, run it in a background thread and inform the main thread (to hide the splash screen) when it is done.

Hwee-Boon Yar
A: 

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

applicationDidFinishLaunching (app-wise) or viewDidLoad (ViewController-wise) is good place to place the code.

ohho