presentViewController is not showing the mail modalview controller. I have changed from presentmodalviewcontroller to presentViewController, but it was not giving any error nor it is presenting the modalview. How to fix this issue?
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];
Two things, one specific to this case, one a general point.
[MFMailComposeViewController canSendMail]
and only show the controller if it's YES
nil
. Before presentViewController:
you might want to check (with an NSLog
or using a debugger) that picker
is not zero.