架构i386的未定义符号:"_ OBJC_CLASS _ $ _ MFMailComposeViewController"

Den*_*yov 14 xcode ios

我使用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)
Run Code Online (Sandbox Code Playgroud)

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

提前致谢!

idz*_*idz 52

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

这是你如何做到的:

  • 在项目导航器侧栏中选择项目.
  • 单击"Build Phases"选项卡.
  • 展开"链接二进制文件库"部分.
  • 单击"+"按钮.
  • 从列表中选择"MessageUI.framework".(您可以使用搜索框找到它).


roo*_*117 5

您可能没有必要的进口:

MessageUI.framework
Run Code Online (Sandbox Code Playgroud)

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