presentViewController未显示邮件模态视图控制器。我已经从presentmodalviewcontroller更改为presentViewController,但它没有给出任何错误,也没有呈现模态视图。如何解决这个问题?
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc]init];
picker.mailComposeDelegate = self;
picker.navigationBar.tintColor = [UIColor colorWithHue:0.6 saturation:0.33 brightness:0.69 alpha:0];
NSString *lObjstringPtr = (NSString *)nil;
if(OPPORTUNITY_ENTITY_OBJECT_TYPE_CODE==m_cobjOwningGroup.m_cObjSelectedEntity.m_cObjectTypeCode) {
lObjstringPtr = [lObjstringPtr stringByAppendingFormat:@" To Follow Up"];
[picker setSubject:lObjstringPtr];
lObjstringPtr = (NSString *)nil;
} else
[picker setSubject:@""];
[picker setMessageBody:m_cObjemailBodyStrPtr isHTML:NO];
NSArray *toRecipients = [NSArray arrayWithObject:pEmailID];
[picker setToRecipients:toRecipients];
[self presentViewController:picker animated:YES completion:nil];
[picker release];
答案 0 :(得分:0)
两件事,一件针对这种情况,一件是一般性的。
[MFMailComposeViewController canSendMail]
的返回值,并仅显示控制器YES
nil
。在presentViewController:
之前,您可能需要检查(使用NSLog
或使用调试程序)picker
不为零。