ios 架构 i386 的未定义符号:“_OBJC_CLASS_$_MFMailComposeViewController”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10838543/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 18:34:33  来源:igfitidea点击:

Undefined symbols for architecture i386: "_OBJC_CLASS_$_MFMailComposeViewController"

iosxcode

提问by Denis Vorobyov

I train in the creation of programs for the iPhone using MFMailComposeViewController. However, an error occurs when compiling:

我训练使用 MFMailComposeViewController 为 iPhone 创建程序。但是编译的时候出现错误:

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

Please help, what is it? And how to fix it?

请帮忙,这是什么?以及如何修复它?

Thanks in advance!

提前致谢!

回答by idz

You must add the MessageUI.framework framework to you project.

您必须将 MessageUI.framework 框架添加到您的项目中。

Here's how you do it:

这是你如何做到的:

  • Select the project in the project navigator sidebar.
  • Click on the "Build Phases" tab.
  • Expand the "Link Binary With Libraries" section.
  • Click the '+' button.
  • Choose 'MessageUI.framework' from the list. (You can use the search box to find it).
  • 在项目导航器侧栏中选择项目。
  • 单击“构建阶段”选项卡。
  • 展开“链接二进制与库”部分。
  • 单击“+”按钮。
  • 从列表中选择“MessageUI.framework”。(您可以使用搜索框找到它)。

回答by rooster117

You likely do not have the necessary imports:

您可能没有必要的导入:

MessageUI.framework

How you add them can be found here importing framework

您可以在此处找到如何添加它们导入框架