Pregunta

I can open a document interaction controller like this:

UIDocumentInteractionController *documentController = [UIDocumentInteractionController interactionControllerWithURL:URL];
documentController.delegate = self;
[documentController presentPreviewAnimated:FALSE];

But if I try to close it programmatically like this:

[documentController dismissPreviewAnimated:FALSE];

The app crashes on the dismissPreviewAnimated line with the message "[QLPreviewController exitFullScreenToRect:inView:]: unrecognized selector sent to instance 0x197500."

My goal is to dismiss the preview from the app delegate whenever the app accepts an incoming file (I'm passing the documentController variable to the app delegate so it can find the controller), but even if I place the dismiss command immediately after the present command, I get the same crash.

The reference to QLPreviewController in the error message tells me that dismissPreviewAnimated is calling an underlying method that is crashing. Even though I'm not using it directly, I tried adding the QuickLook framework to my project, but that didn't help.

I don't see anything in the documentation about this, and I'm not finding any examples or info when I search the web or the developer forums for "UIDocumentInteractionController dismissPreviewAnimated". Can anyone shed some light on this?

¿Fue útil?

Solución

Okay, this is confirmed by Apple as a bug in iOS 4.3.

Edit: I've confirmed this was fixed in iOS 5.0.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top