Сбой UIDocumentInteractionController с presentOpenInMenuFromBarButtonItem: метод
Я пытался открыть PDF-файл с помощью меню "Открыть в", но при его создании происходит сбой кода при вызове метода presentOpenInMenuFromBarButtonItem
UIDocumentInteractionController * controller;
controller = [UIDocumentInteractionController interactionControllerWithURL:fileUrl];
controller.delegate = self;
[controller presentOpenInMenuFromBarButtonItem:_openInBBItem animated:YES];
Там нет сообщения об ошибке.
Вы можете мне помочь?
1 ответ
Решение
Решение состоит в том, чтобы сохранить ссылку на UIDocumentInteractionController.
.час
@property UIDocumentInteractionController* interact;
.m
_interact = [UIDocumentInteractionController interactionControllerWithURL: fileUrl];
_interact.delegate = self;
[_interact presentOpenInMenuFromBarButtonItem: _openInBBItem animated:YES];