1

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...

Dan Messing
  • 818
  • 7
  • 16

1 Answers1

3

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.

Dave Ross
  • 673
  • 4
  • 12