首页 > 解决方案 > 催化剂:UIKit 中缺少 UIReferenceLibraryViewController?

问题描述

在我的 iOS 应用程序中,我使用 UIReferenceLibraryViewController (UIKit) 在字典中查找单词。工作正常。在为 Catalyst 构建时,我得到:

Showing Recent Issues
Undefined symbol: _OBJC_CLASS_$_UIReferenceLibraryViewController

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_UIReferenceLibraryViewController", referenced from:
      objc-class-ref in WoordvinderViewController.o
      objc-class-ref in AnagramViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

UIReferenceLibraryViewController 只是从 UIKit 框架中丢失,还是我错过了什么?

Apple 的代码级别支持告诉我报告错误...嗯.. 在错误报告器中进行反馈,但错误报告未得到确认。Xcode 12 beta 没有修复它,Xcode 12 也没有发布。

标签: xcodeuikitmac-catalyst

解决方案


尽管文档说它受支持,但该类尚未为 Catalyst 实现。我什至检查了 UIKit 的 macOS 端口,/System/iOSSupport/System/Library/PrivateFrameworks/UIKitCore.framework/Versions/A/UIKitCore发现没有引用该类。

我想目前唯一的解决方案是创建一个 macOS 插件,通过调用NSView.showDefinition().


推荐阅读