UIDocumentsInteractionController shows iBooks but doesn't open it

只愿长相守 提交于 2019-12-05 14:15:58

For those stuck at this: You don't need to set yourself up as UIDocumentInteractionController's delegate at all.

Problem was [UIDocumentInteractionController interactionControllerWithURL:url] is being autoreleased. It thought it would be retained internally by the action sheet being shown but apparently it's not. So yea, gotta retain it until action sheet dismisses.

Try checking the UIDocumentInteractionControllerDelegate methods documentInteractionController:willBeginSendingToApplication: and documentInteractionController:didEndSendingToApplication:. If your view controller is the delegate of the document interaction controller, that should clue you in to where the problem may be.

Also, you should validate that the file you're trying to use elsewhere (a PDF I assume) is actually a what you expect it to be.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!