2013-05-27 51 views
0

我试图打开的“打开方式”菜单中选择一个PDF文件,但是当我创建它,代码崩溃时,我称之为presentOpenInMenuFromBarButtonItem方法UIDocumentInteractionController崩溃与presentOpenInMenuFromBarButtonItem:方法

UIDocumentInteractionController * controller; 
     controller = [UIDocumentInteractionController interactionControllerWithURL:fileUrl]; 
     controller.delegate = self; 

     [controller presentOpenInMenuFromBarButtonItem:_openInBBItem animated:YES]; 

没有错误信息。

你能帮我吗?

回答

0

解决方法是在UIDocumentInteractionController上保留一个引用。

.H

@property UIDocumentInteractionController* interact; 

.M

_interact = [UIDocumentInteractionController interactionControllerWithURL: fileUrl]; 
_interact.delegate = self; 
[_interact presentOpenInMenuFromBarButtonItem: _openInBBItem animated:YES];