自定义 class 下拉列表中未显示 EDStarRating?

Not Showing EDStarRating in Custom class dropdown list?

我已将 EDStarRating 集成到我的应用程序中。它在一个 viewcontroller 上运行良好。但奇怪的问题是它不适用于另一个视图控制器。

我搜索了几乎所有 google 与此问题相关的问题,但对我没有任何帮助。

我已经从我重新添加的应用程序中删除了 EDStarRating。然后它也没有显示在自定义 class 下拉列表中。我已经检查了构建阶段,它就在那里。

另一件奇怪的事情是它没有显示在自定义 class 下拉列表中,但它在一个视图控制器上工作正常没有问题。 尝试在另一个视图控制器上应用同样的事情会出错。

Unknown class _MyApplication14MYEDStarRating in Interface Builder file.

感谢帮助

您是否在 Swift 中同时编写它适用的视图控制器和不适用的视图控制器?您正在为 Objective-C class 获取模块损坏的 class 名称,这表明您 运行 陷入了此错误的一种形式:

Objective-C class is interpreted as Swift class in Interface Builder

Actual Results: Outlet will refer to a Swift class - Name is mangled with App module name, so it can't resolve to an instance of that class.

The result is the subview having the original class in interface builder. If it was dragged from a 'View', it will be an instance of UIView, if it was dragged from 'ImageView', it will be an instance of UIImageView.

我的建议是查看情节提要的源代码(右键单击“打开方式”>“源代码”)并手动将 customClass 从有效的实例复制到无效的实例吨。假设它们不同,Interface Builder 就会感到困惑。如果它们没有不同……那么就会有一些更微妙的 Swift/Objective-C 桥接问题。可能只是在 Swift 中重写 EDStarRating 会比弄清楚它更快,真的。