架构i386的未定义符号:“_OBJC_CLASS _ $ _ MFMailComposeViewController”

我使用MFMailComposeViewController来为iPhone创build程序。 但是,编译时出现错误:

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) 

请帮忙,这是什么? 以及如何解决它?

提前致谢!

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

以下是你如何做到这一点:

  • 在项目导航器侧栏中select项目。
  • 点击“Build Phases”标签。
  • 展开“链接二进制库”部分。
  • 点击“+”button。
  • 从列表中select“MessageUI.framework”。 (您可以使用search框find它)。

您可能没有必要的import:

 MessageUI.framework 

如何添加它们可以在这里find导入框架