Why does presentModalViewController not always work?

Posted by E-Madd on Stack Overflow See other posts from Stack Overflow or by E-Madd
Published on 2010-03-12T04:57:18Z Indexed on 2010/04/23 4:53 UTC
Read the original article Hit count: 349

Filed under:
|
|

My application requires data from a server in order to run. The first thing it does is displays a view controller (LoadingViewController) that is responsible for checking if the data is saved to my PersistentStoreCoordinator. If the data isn't cached locally, it gets it from my server and caches it, and posts a notification that the LoadingViewController is listening for. When that notification comes through, LoadingViewController presents the application's MainViewController using the presentModalViewController with a flip animation. So far, so good... no errors.

However, if the application loads and determines the data IS cached - the presentModalViewController does not work and the main application view never appears. No errors. I've even gone as far as adding a button to the Loading view that executes the same code when pressed and the damn thing works.

I'm suspicious it has something to do with the timing of it all but I'm clueless as to what I can do to ensure the view is displayed with that flipping animation if the data is already cached locally. Any suggestions?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about cocoa-touch