【问题标题】:SLComposeViewController is not working in iPhone 6SLComposeViewController 在 iPhone 6 中不起作用
【发布时间】:2014-12-21 01:14:53
【问题描述】:

我面临一个问题,在 64 位架构 iOS 设备中,共享功能(Twitter 和 Facebook)不起作用,当我在 32 位架构 iOS 设备中运行相同的代码时,它工作正常。我也将架构更改为 armv7 armv7s arm64。但我仍然面临同样的问题。

/* Facebook sharing  */
SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
    [controller setInitialText:ARTICLE_GLOBAL_Title];
    [controller addImage:[UIImage imageNamed:@"144X144.png"]];
    [controller addURL:[NSURL URLWithString:ARTICLE_GLOBAL_Link]];
    [self presentViewController:controller animated:YES completion:nil];

这是输出

插件 com.apple.share.Facebook.post 中断 Hub 连接错误 Error Domain=NSCocoaErrorDomain Code=4097 “操作无法完成。(Cocoa 错误 4097。)”(连接到名为 com.apple.share 的服务.Facebook.post) UserInfo=0x7f839249d090 {NSDebugDescription=连接到名为 com.apple.share.Facebook.post 的服务}

【问题讨论】:

  • 你使用的是哪个版本的xcode?​​span>
  • 请给我一些建议,怎么办??
  • 你在设备上测试了吗?
  • 我有 iPhone 4s。关于它的工作正常。但是当我在模拟器 iPhone 6 中运行此代码时,它会在控制台上显示错误消息。
  • 你的 4s 在 iOS 8 上运行吗?

标签: ios iphone slcomposeviewcontroller


【解决方案1】:

我遇到了仅在 iOS 8 上出现的类似问题。我通过删除 addURL: if the device is running iOS 8 解决了该错误。

 if (!SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
    [controller addURL:[NSURL URLWithString:ARTICLE_GLOBAL_Link]];
 }

在哪里

#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v)  ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)

将 URL 附加到帖子似乎是一个问题。对于 iOS 8,我将 URL 附加到初始文本而不是使用 addURL:.

【讨论】:

    猜你喜欢
    • 2015-12-28
    • 1970-01-01
    • 2015-01-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-23
    • 2012-09-25
    • 1970-01-01
    相关资源
    最近更新 更多