I\'m using Core Data in my project and get a rare crash in the following code section
-(void) useDocument{
AFFormsCoreDataEngine* engine = [AFFormsCore
Well, an assertion is failing in the UIDocument code. You should probably provide more code, because you are obviously setting something up improperly.
The assertion is then throwing an exception. If you @catch exceptions in this method, you can log the exception.
Or, you can assign your own NSAssertionHandler to the thread, and see the assertion directly.
The error occurs if your app attempts to call your useDocument method twice in close succession.
Because the openWithCompletionHandler: opens the document asynchronously, the document may still be opening when the method is called again.
If this happens, your app ends up trying to open the document twice (as the document state will remain UIDocumentStateClosed until completion) and this causes the exception to be thrown.
If you have an exception breakpoint, you may see something like this in the console:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'attempt to open or a revert document that already has an open or revert operation in flight: