我尝试使用FBSDKShareKit实现共享功能,但是当无法创建FBSDKShareDialog时。代码在这里:
let content = FBSDKShareLinkContent()
content.contentDescription = "Some discription"
content.contentTitle = self.name!
content.imageURL = self.imgURL
let shareDialog = FBSDKShareDialog()
shareDialog.shareContent = content
shareDialog.delegate = nil
shareDialog.fromViewController = self
shareDialog.show()
执行第let shareDialog = FBSDKShareDialog()
行时,应用程序崩溃并将此错误消息抛出到控制台:
libc++abi.dylib: terminating with uncaught exception of type NSException
有人知道为什么会这样吗?