2011-12-03 9 views
0

私は完全に困惑しています。私はユーザーがMFMailComposeViewControllerを介して電子メールを送信させようとしています。私はHTMLのボディと私のMFMailComposeViewControllerを設定するときしかし、MFMailComposeViewControllerが正しくメールを表示しますが、自分のアプリケーションがクラッシュしたが、このようなログでメールを送信する上:HTML本体の設定時にMFMailComposeViewControllerがiOS5でクラッシュする

2011-12-03 15:04:08.708 Kinopilot[58387:17503] *** Terminating app due to uncaught 
    exception 'DOMException', reason: '*** INVALID_ACCESS_ERR: DOMException 15' 
*** First throw call stack: 
(0x2994052 0x210fd0a 0x2993f11 0x391affb 0x3886795 0x64a9b4 0x6487b6 
0x648b84 0x648bb4 0x648bb4 0x6424b9 0x69078b 0x658fad 0x658eeb 0x658e6f 
0x656d37 0x656bb2 0x65737c 0x65759e 0x658273 0x658758 0x6588e6 0x2995ec9 
0x10965c2 0x12d1d54 0x2995ec9 0x10965c2 0x109655a 0x113bb76 0x113c03f 
0x113b2fe 0x10bba30 0x10bbc56 0x10a2384 0x1095aa9 0x2270fa9 0x29681c5 
0x28cd022 0x28cb90a 0x28cadb4 0x28caccb 0x226f879 0x226f93e 0x1093a9b 0x6680d 0x663d5) 

私はMFMailComposeViewControllerが有線であることをかなり確信しています私はボディをプレーンテキストとして設定すると、すべて正常です。さらに、私のコードは、iOS 4.3でHTMLとプレーンテキストでうまく動作します。

これは、関連するコードです:

@interface MailComposeDelegate: NSObject<MFMailComposeViewControllerDelegate> 
@end 

@implementation MailComposeDelegate 

+(MailComposeDelegate*) sharedMailComposeDelegate 
{ 
    static MailComposeDelegate* mcd = nil; 
    if(!mcd) { 
    mcd = [[MailComposeDelegate alloc]init]; 
    } 

    return mcd; 
} 

-(void)mailComposeController:(MFMailComposeViewController*)controller 
      didFinishWithResult:(MFMailComposeResult)result 
         error:(NSError*)error 
{ 
    [app.window.rootViewController dismissModalViewControllerAnimated:NO]; 
} 

... 

@implementation M3AppDelegate(Email) 

-(void)composeEmailWithSubject: (NSString*)subject 
         andBody: (NSString*)body 
{ 
    // -- compose HTML message. 

    MFMailComposeViewController* mc; 
    if([MFMailComposeViewController canSendMail]) 
    mc = [[MFMailComposeViewController alloc] init]; 

    if(!mc) return; 

    mc.mailComposeDelegate = [MailComposeDelegate sharedMailComposeDelegate]; 

    [mc setSubject: subject]; 
    [mc setMessageBody: body isHTML: YES]; 

    // -- show message composer. 

    [app.window.rootViewController presentModalViewController:mc animated:YES]; 
} 

@end 

答えて

1

ハ、ここで自分の質問に答える:いくつかのiOS5を成分は、私のマークアップの一部を処理しないだろう、すなわち

<div style='font-size: 85%'> 

のdivを。相対的なサイズを絶対的なピクセルの高さに変更してもうまくいきました。

関連する問題