在我的iphone應用程序中。我正在使用MFMailComposeViewController
創建Iphone郵件聊天表。現在,當我第二次輸入郵件時,我的應用程序正在崩潰。我在谷歌搜索。但我找不到解決方案。任何人都可以幫我解決我的問題。請看下面的代碼,並幫助我在哪裏做錯了。當我輸入iphone郵件表時,iPhone應用程序崩潰
if ([MFMailComposeViewController canSendMail])
{
controller = [[MFMailComposeViewController alloc] init];
controller.mailComposeDelegate = self;
[controller setSubject:@""];
[controller setToRecipients:array1];
[controller setMessageBody:@"" isHTML:NO];
[controller setMailComposeDelegate: self];
[controller setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
[self.navigationController presentModalViewController:controller animated:NO];
[controller release];
}
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
if(result == MFMailComposeResultSent)
{
[[self parentViewController] dismissModalViewControllerAnimated:YES];
}
else if (result == MFMailComposeResultCancelled)
{
[[self parentViewController] dismissModalViewControllerAnimated:YES];
}
}
您正在使用哪個版本的xcode? – Rushabh
@Rocks感謝您的回覆。 IOS5。 – Gopinath
你的NSLog顯示什麼錯誤? –