【问题标题】:Problems with SFSafariViewControllerSFSafariViewController 的问题
【发布时间】:2016-03-05 02:16:58
【问题描述】:

作为 iOS 9 ATS 更改的一部分,我正在更新一个应用程序以将 SFSafariViewController 用于第三方 http 网站。

当我初始化并呈现实例时,我得到的只是一个空白的白色视图。没有导航栏,没有内容……什么都没有。这发生在设备 (iOS 9.1) 和模拟器 (iOS 9.1) 上。但是在设备上我在一分钟左右后收到以下调试器消息:

Failed to get remote view controller with error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.uikit.viewservice.com.apple.SafariViewService was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid." UserInfo={NSDebugDescription=The connection to service named com.apple.uikit.viewservice.com.apple.SafariViewService was interrupted, but the message was sent over an additional proxy and therefore this proxy has become invalid.}

该应用正确地包含了 SafariServices 框架。我创建了一个测试项目,看看我的 SDK 安装是否有问题,但该项目运行良好。

我已通过 Apple Developer Portal 请求支持,并在 Apple Developer Forums 上提出了这个问题。有人知道这是什么或如何解决吗?

【问题讨论】:

    标签: ios safari app-transport-security


    【解决方案1】:

    Apple 开发者技术支持已回复我以下信息:

    Safari 视图控制器使用的工具栏类中存在错误 这导致它不断地执行布局(本质上是在一个 无限循环)如果它或其任何条形按钮有背景图像 通过外观代理应用。

    作为一种解决方法,您要么需要删除这行代码,要么 将外观自定义限制为 UIBarButtonItem 包含在您自己的视图控制器中(您 可能需要继承 UINavigationController 以便您可以定位 您的子类与 [UIBarButtonItem appearanceWhenContainedIn:])。

    【讨论】:

      【解决方案2】:

      很高兴看到您用于实例化 SFVC 的代码,但尽管如此,请确保您像这样使用 initWithURL:

      SFSafariViewController *sfvc = [[SFSafariViewController alloc]initWithURL:URL entersReaderIfAvailable:YES];
      

      【讨论】:

      • 我在上面贴了正确的答案。我将 UIAppearance 用于条形按钮项,由于 SFSafariViewController 中的错误而导致问题。
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-05-31
      • 2015-12-14
      • 2015-11-02
      • 2018-06-18
      • 1970-01-01
      相关资源
      最近更新 更多