Search code examples
iphoneuiviewcontrollerfmdb

display splash screen (UIViewController) while database (FMDB) is loading iPhone


I have a bit of issue with my application.
I have WebServices that receive information than parse it and store the information in a database.

What I want is my splash screen (or UIViewController) to be display until the all of information is uploaded to the database (FMDB is the db I am using).

Currently what I have a the screen loading for a certain period of time and than it is removed. The code I am using is:
[self performSelector:@selector(removeSplashScreen) withObject:nil afterDelay:30];

The problem is some of the information is loaded to the database, while other isn't.

Can any give me hints on how to resolve this issue.

NOTE: The splash screen isn't that actually splash screen (which is Default.png), this is just a UIViewController displayed after that splash screen I am just calling it the splash screen.

Thanks


Solution

  • You can do this by providing a notification or delegate method to indicate the completion of the parsing. This can then be used to remove the splash screen. That said its not a good approach to show the splash screen till the data is loaded. what if there is a considerable delay for loading the data. Please rethink your approach. This approach wont go well with Apple normally.