1

我在现有的 swift 基础项目中添加了一组 Objective C 类和一个故事板。我还添加了桥接头文件,但是当我从 swift 代码中实例化一个目标 c 类时,我遇到了这个错误。我已经看到了很多答案和问题,但没有一个可以解决我的问题。

我还根据此链接检查了 .m 文件,并且一切都在那里。我在界面下添加了@implementation。

体系结构 x86_64 的未定义符号:“_OBJC_CLASS_$_ContactViewController”,引用自:ContactVC.o ld 中的 objc-class-ref:未找到体系结构 x86_64 的符号:错误:链接器命令失败,退出代码为 1(使用 -v查看调用)

这是我的快速代码。

  let storyBoard = UIStoryboard(name: "Contacts", bundle: nil)
   let contactsViewController = storyBoard.instantiateViewController(withIdentifier: "ContactViewController") as? ContactViewController
    navigationController?.pushViewController(contactsViewController!,
                                             animated: true)
4

0 回答 0