在'id <nsfastenumeration,nsobject>'类型的对象上找不到字典元素的预期方法

时间:2018-04-09 06:48:02

标签: ios objective-c xcode promise cocoapods

我无法在Xcode 9.3上构建我的项目。构建失败。但我正在使用下面的pod文件。问题只发生在Pod文件中。

pod 'PromiseKit/Foundation', '~> 1.5.0'
pod 'PromiseKit-AFNetworking', '~> 0.1.7'

错误:

PMKPromise *promise = promises[key]; ---> error (Expected method to read dictionary element not found on object of type 'id<NSFastEnumeration,NSObject>')

我的项目正在开发Xcode 9.2版本。仅发行Xcode 9.3

2 个答案:

答案 0 :(得分:1)

尝试以下播客

pod 'PromiseKit/Foundation', '~> 1.7.2'
pod 'PromiseKit-AFNetworking', '~> 0.1.6'

答案 1 :(得分:0)

将您的广告更新为:

@Autowired
private JavaMailSender javaMailSender;

public void sendEmailWithInlineImage() {
    MimeMessage mimeMessage = null;
    try {
        InternetAddress from = new InternetAddress(from, personal);
        mimeMessage = javaMailSender.createMimeMessage();
        mimeMessage.setSubject("Test Inline");
        MimeMessageHelper helper = new MimeMessageHelper(mimeMessage, true);
        helper.setFrom(from);
        helper.setTo("test@test.com");
        String contentId = ContentIdGenerator.getContentId();
        String htmlText = "Hello,</br> <p>This is test with email inlines.</p><img src=\"cid:" + contentId + "\" />";
        helper.setText(htmlText, true);

        ClassPathResource classPathResource = new ClassPathResource("static/images/first.png");
        helper.addInline(contentId, classPathResource);
        javaMailSender.send(mimeMessage);
    }
    catch (Exception e) {
        LOGGER.error(e.getMessage());
    }

}