点击“消息”应用时,UIActivityController崩溃

问题描述

我正在用目标C代码编写iOS应用,这是当用户点击barItem上的按钮时采取的措施

- (void)tappedInToolbar:(MyToolbar *)toolbar shareButton:(UIButton *)button {
   
     UIActivityViewController *activityController = [[UIActivityViewController alloc]
                                      initWithActivityItems:@[self,document.fileURL] 
                                      applicationActivities:nil];
      
     activityController.modalPresentationStyle = UIModalPresentationPopover;
    
     [self presentViewController:activityController animated:YES completion:nil];
    
     UIPopoverPresentationController *popController = [activityController popoverPresentationController];
      
     popController.permittedArrowDirections = UIPopoverArrowDirectionAny;
      
     popController.sourceView = button;
     
 }

该应用程序能够成功显示活动控制器 而且我可以选择许多系统应用程序来共享我的文件,例如“空投”邮件,便笺等;但是,每当我点击“消息”以共享文件时,该应用都会因该堆栈跟踪而崩溃。

如果有人知道如何解决此问题,请分享,将不胜感激。

1   
IOSurface
IOSurfaceClientGetPixelFormat + 0
2   
QuartzCore
CA::CG::IOSurfaceContext::create_delegate(CGIOSurfaceContextInfo const*,__CFDictionary const*) + 544
3   
CoreGraphics
CGIOSurfaceContextCreate + 212
4   
BaseBoardUI
BSUISurfaceWithColorSpaceAndDrawBlock + 536
5   
SpringBoardFoundation
SBFCreateIOSurfaceForImage + 1092
6   
ChatKit
-[CKRemoteItemForSending _setPreviewUIImage:] + 80
7   
ChatKit
__46-[CKRemoteItemForSending beginPreviewCreation]_block_invoke + 208
8   
Foundation
__NSBLOCKOPERATION_IS_CALLING_OUT_TO_A_BLOCK__ + 20
9   
Foundation
-[NSBlockOperation main] + 100
10  
Foundation
__NSOPERATION_IS_INVOKING_MAIN__ + 20
11  
Foundation
-[NSOperation start] + 736
12  
Foundation
__NSOPERATIONQUEUE_IS_STARTING_AN_OPERATION__ + 20
13  
Foundation
__NSOQSchedule_f + 180
14  
libdispatch.dylib
_dispatch_block_async_invoke2 + 140
15  
libdispatch.dylib
_dispatch_client_callout + 16

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)