2012-11-16 2 views
0

아이폰 OS에서 이메일 메시지를 제시 할 때 이상한 어설 션 실패를 얻기어설 션 실패

코드 : 스위 즐링의 위험 아아

 
- (void)displayComposerSheet:(id)delegate withDataSource:(id)datasource { 
    MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; 
    picker.navigationBar.tintColor = self.navigationController.navigationBar.tintColor; 
    picker.mailComposeDelegate = delegate; 
    //Use the datasource to fill in the email fields 
    if ([[datasource recipients] count] > 0) 
     [picker setToRecipients:[datasource recipients]]; 
    [picker setSubject:[datasource subject]]; 

    [picker setMessageBody:[datasource emailText] isHTML:[datasource isHTML]]; 
    [[UIWindow topMostController] presentModalViewController:picker animated:YES]; 
    [picker becomeFirstResponder]; 

    [picker release]; 
} 

 
MyApp[60324:907] *** Assertion failure in -[MFMailComposeInternalViewController _endDelayingCompositionPresentation], /SourceCache/MessageUI/MessageUI-1075.10/Mail/MFMailComposeInternalViewController.m:316 

답변

0

....

내가했다 내부적으로 setViewController를 사용하는 자체 메서드를 사용하여 UINavigationController의 pushViewController 메서드를 변경했습니다. (동일한 뷰 컨트롤러가 두 번 푸시 된 스레딩 문제가 발생했습니다.)