Question

Can a single instance of a UIDocument not be opened and closed multiple times? It seems that I can open, close, and re-open a document, but as soon as I try to call closeWithCompletionHandler: on it a second time I get an exception:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'closeWithCompletionHandler called while document is already closing'

Prior to the call the documentState is Normal.

Hopefully I'm just overlooking something obvious...

Was it helpful?

Solution

Instead of re-opening a closed document with openWithCompletionHandler, create a fresh UIDocument subclass instance and initialize it first with initWithFileURL and then open it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top