При попытке отправить письмо с простым приложением KML (всего несколько байтов) я получаю предупреждения ниже в консоли во время отправки. Можно ли это игнорировать или я допустил ошибку? Кажется, письмо отправлено OK
- (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 со ссылками на карты Google.
Предупреждения в консоли:
2010-02-21 14:23:38.809 DataTap[2008:850f] DA|Could not open the lock file at /tmp/DAAccountsLoading.lock. We'll load the accounts anyway, but bad things may happen
2010-02-21 14:23:41.420 DataTap[2008:207] DA|Pipe to DADaemon was lost. Search query 2147483647 is returning an error
[Switching to thread 13827]
2010-02-21 14:23:44.197 DataTap[2008:207] DA|Pipe to DADaemon was lost. Search query 2147483647 is returning an error
2010-02-21 14:23:45.357 DataTap[2008:207] DA|Pipe to DADaemon was lost. Search query 2147483647 is returning an error
2010-02-21 14:23:45.855 DataTap[2008:207] DA|Pipe to DADaemon was lost. Search query 2147483647 is returning an error
2010-02-21 14:23:48.543 DataTap[2008:207] DA|Pipe to DADaemon was lost. Search query 2147483647 is returning an error
2010-02-21 14:23:48.848 DataTap[2008:207] DA|Pipe to DADaemon was lost. Search query 2147483647 is returning an error
«Могут случиться плохие вещи» - бредовое свидетельство человеческих программистов в Apple!
Я видел этот вопрос электронное письмо со звуком , в котором сообщается об одной из моих ошибок. Соответственно, я попытался изменить тип MIME моего вложения на text / xml, что не имело никакого значения, и полностью удалить вложение, после чего ошибки пошли.
Итак, это может вызвать сбои или это безопасно?