I am writing the iOS app in objective C code and this is the method for action when user taps on a button on the 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;
}
The app is able to present the Activity Controller successfully and I can select many system apps to share my files such as 'Airdrop' Mail, Notes etc; However whenever I tap on the Messages to share the files the app will crash with this stack trace.
If anyone know how to fix this problem please share, it would be really appreciated.
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