I am running into a weird problem. I am sure that I did something to a file somewhere else in my code and it didn't close properly or something, but now it is in a state where it reports as being closed, but when I call OpenWithCompletionHandler it never returns. See below:
//if the file is closed, open it and then set up the controller
if (file.documentState == UIDocumentStateClosed){
//---- this code executes
[file openWithCompletionHandler:^(BOOL success){
// ---- this code NEVER executes
}];
}
Any ideas?
I was having the same problem.
Are you trying to open the document inside viewDidLoad?
Try moving the code to another method. It solved the problem for me.
in ViewController.h
in ViewController.m
See Bug in iPhone Simulator 5.1 with Xcode 4.5 using UIManagedDocument.
My solution was along the same lines as those reported, but I had to lower the Deployment Target of my app to iOS 5.0 so that "iPhone 5.0 Simulator" was available as a run target. I have only seen this issue trying to use the iPhone 5.1 Simulator with XCode 4.5.2, both the 5.0 and 6.0 simulators work.