iOS知识库

Mailcore2的一些坑

2017-03-09  本文已影响1054人  jemmy_xl

该博客主要描述我所遇到的问题情况。配置环境我附上连接自己去看看。

Mailcore2的配置

For iOS - If you're targeting iOS, you have to link against MailCore 2 as a static library:

1.Add libMailCore-ios.a
2.Add CFNetwork.framework
3.Add Security.framework
4.Set 'Other Linker Flags': -lctemplate-ios -letpan-ios -lxml2 -lsasl2 -liconv -ltidy -lz -lc++ -lresolv -stdlib=libc++ -ObjC
5.Make sure to use LLVM C++ standard library. Open Build Settings, scroll down to 'C++ Standard Library', and select libc++.
6.In Build Phases, add a Target Dependency of static mailcore2 ios.

该视频是iOS配置的视频 不过有些地方和官方代码不一样,还是以官方的代码配置为主,具体那里不同自己看后对比就知道

遇到的坑

以上解决后就可以跑起代码了。

附加其他情况:
unzip: cannot find zipfile directory in one of ctemplate-osx-3.zip or
ctemplate-osx-3.zip.zip, and cannot find ctemplate-osx-3.zip.ZIP, period.
/Users/somewhere/mailcore2-0.6.2/scripts/include.sh/build-dep.sh: line 329: cd: ctemplate-osx-3: No such file or directory

找不到'libetpan / libetpan.h'文件

找不到'unicode / udat.h'文件

找不到'ctemplate / template.h'文件

该问题是应该你导入的mailcore2中的libMailCore-ios.a为红色没有导入成功。
解决方法:
1.先运行 static mailcore2 ios

  1. 再运行 mailcore2 ios
    3.再选择你自己的schemes的项目进行运行。
    最后libMailCore-ios.a 库就导入进来了。(如果还是不行的话,用4g进行 下载libMailCore-ios.a)

解决中文名字的文件夹乱码问题
[[imapSession defaultNamespace] componentsFromPath:folder.path])

问题:如何添加正文附件
for (NHLineAttachment *lineAttachment in lineAttachmentArray) {
MCOAttachment *attachment = [MCOAttachment attachmentWithContentsOfFile:lineAttachment.attach_localfile];
attachment.contentID = lineAttachment.attach_contentID;
[attachment setInlineAttachment:YES];
[messageBuilder addRelatedAttachment:attachment];
}

上一篇 下一篇

猜你喜欢

热点阅读