MFMailComposeViewController 不链接模拟器
首先,我使用 XCode 4.0.2。
好吧,这是我的问题。我可以为 MFMailComposerViewController 构建 Apple 示例程序并在模拟器中运行它(我知道它不会发送电子邮件,我只是担心它会构建)。这似乎运作良好。
然而,当我尝试构建我的应用程序时,我收到以下消息。
ld: warning: ignoring file /Users/lloyd/Projects/iOS/simpleApp/MessageUI.framework/MessageUI,
missing required architecture i386 in file
Undefined symbols for architecture i386: "_OBJC_CLASS_$_MFMailComposeViewController", referenced from:
objc-class-ref in MailData.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
解决方案
查看“构建设置”(基本和组合),我发现我设置了“框架搜索路径”。这很奇怪,因为我从来不记得设置过它。删除它解决了问题。
我现在可以为模拟器和目标进行构建。注意:您无法从模拟器发送电子邮件,但您仍然应该能够运行代码(如果有意义的话)。
First off, I'm using XCode 4.0.2.
Okay, here is my issue. I can build Apple sample program for MFMailComposerViewController and run it in the simulator (I am aware it will not send email, I'm just concerned that it builds). That seems to work fine.
HOWEVER, when I try to build in my application I get the following message.
ld: warning: ignoring file /Users/lloyd/Projects/iOS/simpleApp/MessageUI.framework/MessageUI,
missing required architecture i386 in file
Undefined symbols for architecture i386: "_OBJC_CLASS_$_MFMailComposeViewController", referenced from:
objc-class-ref in MailData.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
SOLUTION
Looking "Build Settings" (Basic and Combined) I saw that I had "Framework Search Path" set. This was odd because I never remembered setting that. Deleting it fixed the problem.
I am now able to build for both the simulator and the target. NOTE: You can NOT send email from the simulator, but you should still be able to run the code (if that makes sense).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
在 Xcode 中,转到目标的构建阶段选项卡。确保您看到 MessageUI.framework。如果不存在,请单击 + 添加新框架。
In Xcode go to the build phases tab for your target. Make sure you see MessageUI.framework. If it's not there click + to add a new framework.
解决方案
查看“构建设置”(基本和组合),我发现我设置了“框架搜索路径”。这很奇怪,因为我从来不记得设置过它。删除它解决了问题。
我现在可以为模拟器和目标进行构建。注意:您无法从模拟器发送电子邮件,但您仍然应该能够运行代码(如果有意义的话)。
这是我的问题的解决方案:)
SOLUTION
Looking "Build Settings" (Basic and Combined) I saw that I had "Framework Search Path" set. This was odd because I never remembered setting that. Deleting it fixed the problem.
I am now able to build for both the simulator and the target. NOTE: You can NOT send email from the simulator, but you should still be able to run the code (if that makes sense).
This was the solution to my problem :)
添加 MessageUI.framework 尽管文档这么说不是必须的。
Add MessageUI.framework although the docs said it is not a must.
将 MessageUI.framework 添加到项目链接的框架和库
Add MessageUI.framework to the project Linked Frameworks and Libraries