在尝试使用简单的 KML 附件(仅几个字节)发送邮件时,我在发送期间在控制台中收到以下警告。这些可以忽略还是我犯了错误?邮件似乎发送正常
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
// Dismiss the e-mail controller once the user is done
[self dismissModalViewControllerAnimated:YES];
}
- (void) emailLocation: (CLLocation*) loc {
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"imhere" ofType:@"txt"];
NSString * kml=nil ;
NSString * finalkml=nil;
NSData * filedata=nil;
NSString * mime= @"application/vnd.google-earth.kml+xml";
if (filePath) kml = [NSString stringWithContentsOfFile:filePath];
if (kml) finalkml = [NSString stringWithFormat:kml,loc.coordinate.longitude, loc.coordinate.latitude,loc.altitude];
if (finalkml) filedata = [finalkml dataUsingEncoding:NSUTF8StringEncoding];
if (([MFMailComposeViewController canSendMail]) && (filedata))
{
MFMailComposeViewController *mcvc = [[[MFMailComposeViewController alloc] init] autorelease];
mcvc.mailComposeDelegate = self;
[mcvc setSubject:@"I'm here"];
NSString *body = [NSString stringWithFormat:@"at %f %f",loc.coordinate.latitude,loc.coordinate.longitude];
[mcvc setMessageBody:body isHTML:YES];
[mcvc addAttachmentData:filedata mimeType:mime fileName:@"imhere.kml"];
[self presentModalViewController:mcvc animated:YES];
}
else {
UIAlertView * av = [[UIAlertView alloc] initWithTitle:@"No Email" message:@"Unable to send email." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[av show];
[av release];
}
}
我已经从上面的电子邮件正文示例中删除了 HTML,因为它弄乱了 SO 格式,但它是一个基本的 HTML 电子邮件,带有指向谷歌地图的链接。
控制台中报告的警告是
2010-02-21 14:23:38.809 DataTap[2008:850f] DA|无法在 /tmp/DAAccountsLoading.lock 打开锁定文件。无论如何我们都会加载帐户,但可能会发生不好的事情 2010-02-21 14:23:41.420 DataTap[2008:207] DA|到 DADaemon 的管道丢失。搜索查询 2147483647 返回错误 [切换到线程 13827] 2010-02-21 14:23:44.197 DataTap[2008:207] DA|到 DADaemon 的管道丢失。搜索查询 2147483647 返回错误 2010-02-21 14:23:45.357 DataTap[2008:207] DA|到 DADaemon 的管道丢失。搜索查询 2147483647 返回错误 2010-02-21 14:23:45.855 DataTap[2008:207] DA|到 DADaemon 的管道丢失。搜索查询 2147483647 返回错误 2010-02-21 14:23:48.543 DataTap[2008:207] DA|到 DADaemon 的管道丢失。搜索查询 2147483647 返回错误 2010-02-21 14:23:48.848 DataTap[2008:207] DA|到 DADaemon 的管道丢失。搜索查询 2147483647 返回错误
“可能会发生坏事”——Apple 人类程序员的绝妙证据!
我已经看到这封带有音频的问题电子邮件,其中报告了我的一个错误。因此,我尝试将附件的 mime 类型更改为 text/xml 这没有任何区别,并完全删除附件,此时错误发生了。
那么 - 这可能会导致崩溃,还是安全?