I have a basic problem synchronizing openWithCompletionHandler: (UIManagedDocument) with the main activities.
Situation: I have a singleton class managing a shared UIManagedDocument. This class provides one method which should deliver the document in a normal state (i.e. creates or opens it, whatever is neccessary). But because openWithCompletionHandler: does its main job asynchronously in the background my program should wait with setting up the fetchedResultsController until the document is really open. The "viewWillAppear" method (currently) produces no useful output when the database is not ready. Waiting would be ok for me, but getting notified probably would be the better way. Maybe viewWillAppear turns out not to be the right point to setupFetchedResultsController because not called in a runloop.
Is there a standard pattern to achieve this?
Bit more of background (not so important I assume) I am working on a little iOS 5.1 app involving a CoreData UIManagedDocument. I resembled the example from Lesson 14 from last fall's Stanford course in iTunes-U. Everything was working fine until I tried to put the handling of the UIManagedDocument away from the UITableViewController class into a seperate class handling my document. In the original version the FetchedResultsController was set up in the completion handler.