単純な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の書式設定を台無しにしていたためですが、これはGoogleマップへのリンクを含む基本的な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の人間プログラマーの輝かしい証拠!
エラーの1つを報告する音声付きのこの質問メールを見ました。したがって、添付ファイルのmimeタイプをtext / xmlに変更してみましたが、違いはありませんでした。添付ファイルを完全に削除すると、エラーが発生しました。
だから-これはクラッシュを引き起こす可能性がありますか、それとも安全ですか?