How to deal with time delay when a SWTableView is being loaded?

193 Views Asked by At

In an iPhone game, I want to display a CCLayer containing a SWTableView when the user taps on the screen. The table mainly contains images.

Now the problem is, on an old device, say ipod touch 2g running iOS4.x, It takes about 1 second or even more to load the table (because it is loading images) before it is displayed on the screen.

I tried to add a spinner view to indicate that the table is being loaded. But the spinner does not get printed on the screen until the table is displayed.

Does anyone have a good strategy to deal with this delay? Or is it at lease possible to do anything between a touch event and the loading of the table?

Any help will be greatly appreciated! Thanks!

1

There are 1 best solutions below

0
On

If you subclass SWTableView, you can implement the init and viewDidLoad methods. In init, put a spinner in the middle of the view, and in viewDidLoad remove the spinner. If that doesn't work you may want to try subclassing CCLayer in the same way.