let content: FBSDKShareLinkContent = FBSDKShareLinkContent()
content.contentURL = NSURL(string: "https://www.google.com")
content.contentTitle = "ContentTitle"
content.contentDescription = "ContentDescription"
let shareDialog = FBSDKShareDialog();
shareDialog.mode = .Browser
shareDialog.shareContent = content
shareDialog.show()
这是我以前分享的代码。
虽然分享我得到了如下所示的崩溃
'NSInvalidArgumentException', reason: '-[FBSDKApplicationDelegate openBridgeAPIRequest:useSafariViewController:fromViewController:completionBlock:]: unrecognized selector sent to instance 0x7fa69031c9d0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010c2f1e65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010bcd8deb objc_exception_throw + 48
2 CoreFoundation 0x000000010c2fa48d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010c24790a ___forwarding___ + 970
4 CoreFoundation 0x000000010c2474b8 _CF_forwarding_prep_0 + 120
5 Store 0x000000010a42a858 -[FBSDKShareDialog _showBrowser:] + 417
6 Store 0x000000010a4297c8 -[FBSDKShareDialog show] + 327
7 Store 0x000000010a351d47 _TFC5Store25StorePlayerViewController17didTapShareButtonfS0_FSiT_ + 1847
8 Store 0x000000010a351e6a _TToFC5Store25StorePlayerViewController17didTapShareButtonfS0_FSiT_ + 42
9 Store 0x000000010a35acb0 _TTDFC5Store25StorePlayerViewController17didTapShareButtonfS0_FSiT_ + 48
10 Store 0x000000010a35231d _TTWC5Store25StorePlayerViewControllerS_31DopeMeterViewControllerDelegateS_FS1_17didTapShareButtonuRq_S1__fq_FSiT_ + 45
11 Store 0x000000010a3e24c9 _TFC5Store23DopeMeterViewController12OnShareClickfS0_FCSo8UIButtonT_ + 201
12 Store 0x000000010a3e254a _TToFC5Store23DopeMeterViewController12OnShareClickfS0_FCSo8UIButtonT_ + 58
13 UIKit 0x000000010c6a1194 -[UIApplication sendAction:to:from:forEvent:] + 92
14 UIKit 0x000000010c8106fc -[UIControl sendAction:to:forEvent:] + 67
15 UIKit 0x000000010c8109c8 -[UIControl _sendActionsForEvents:withEvent:] + 311
16 UIKit 0x000000010c80faf8 -[UIControl touchesEnded:withEvent:] + 601
17 UIKit 0x000000010c71049b -[UIWindow _sendTouchesForEvent:] + 835
18 UIKit 0x000000010c7111d0 -[UIWindow sendEvent:] + 865
19 UIKit 0x000000010c6bfb66 -[UIApplication sendEvent:] + 263
20 UIKit 0x000000010c699d97 _UIApplicationHandleEventQueue + 6844
21 CoreFoundation 0x000000010c21da31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
22 CoreFoundation 0x000000010c21395c __CFRunLoopDoSources0 + 556
23 CoreFoundation 0x000000010c212e13 __CFRunLoopRun + 867
24 CoreFoundation 0x000000010c212828 CFRunLoopRunSpecific + 488
25 GraphicsServices 0x000000010f640ad2 GSEventRunModal + 161
26 UIKit 0x000000010c69f610 UIApplicationMain + 171
27 doopaadoo 0x00000001090a019d main + 109
28 libdyld.dylib 0x0000000112cb192d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
我搜索很多bt找不到任何解决方案。