2
[MFMailComposeViewController canSendMail] issue
source link: https://fann.im/blog/2011/12/27/mfmailcomposeviewcontroller-cansendmail-issue/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
[MFMailComposeViewController canSendMail] issue
Dec 27, 2011
发现 MFMailComposeViewController
一个挺奇怪的问题,代码一:
if ([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *mailComposer = [[MFMailComposeViewController alloc] init];
[mailComposer setSubject:@"Mail"];
//...
[self presentModalViewController:mailComposer animated:YES];
[mailComposer release];
}
如果设备没有设置 Mail,那么该操作不会有任何反应。不会有弹窗出现。
MFMailComposeViewController *mailComposer = [[MFMailComposeViewController alloc] init];
if (![MFMailComposeViewController canSendMail]) {
return;
}
//...
代码二这种情况下如果没有设置 Mail,会有系统弹窗提示 “无邮件账户”。
Was this page helpful?
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK