【发布时间】:2010-11-26 06:07:28
【问题描述】:
我使用 MessageUI 框架 从我的应用程序发送带有附件的邮件。 但是我得到了以下错误,
2009-09-07 19:52:23.483 emailTest[11711:5b17]
Error loading /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/DataClassMigrators/AccountMigrator.migrator/AccountMigrator: dlopen(/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/DataClassMigrators/AccountMigrator.migrator/AccountMigrator, 265): Library not loaded: /System/Library/PrivateFrameworks/MobileWirelessSync.framework/MobileWirelessSync
Referenced from: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk/System/Library/DataClassMigrators/AccountMigrator.migrator/AccountMigrator
Reason: image not found
2009-09-07 19:52:23.489 emailTest[11711:5b17] [+[AccountsManager _migrateAccountsIfNeeded]] Accounts migration failed
[Switching to process 11711 local thread 0xf03]
我的代码是,
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc]init];
picker.mailComposeDelegate = self;
[picker setSubject:@"This is iPhone email attachment test"];
UIImage *sampleImg = [UIImage imageNamed:@"iPhone.jpg"];
NSData *imageData = UIImageJPEGRepresentation(sampleImg, 1);
[picker addAttachmentData:imageData mimeType:@"image/png" fileName:@"iPhone.jpg"];
NSString *emailBody = @"I am sending the image attachment with iPhone email service";
[picker setMessageBody:emailBody isHTML:YES];
[self presentModalViewController:picker animated:YES];
[picker release];
请帮帮我。
【问题讨论】:
-
更具体 - 您正在运行什么代码来创建附件?要分离消息?您究竟是如何“使用 MessageUI 框架”的?
-
请看代码。
-
嗨,你的代码工作了吗?触摸电子邮件中的发送按钮时,我也收到了相同的消息。但是,我没有在邮件中添加任何附件。当我触摸取消按钮时,我无法关闭邮件控制器。我正在将邮件控制器添加到 cocos2d 层。请提供任何帮助。谢谢。
标签: iphone objective-c email mfmailcomposer