我不确定我是否理解MFMailComposeViewController
正确。我期待一个具有现有视图的视图控制器出现在我的屏幕上。我可以看到 FTViewController 的视图。但是邮件作曲家从未出现。
我已将原始问题简化到最低限度。
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
FTViewController *vc = [[FTViewController alloc]init];
self.window.rootViewController = vc;
..
}
在 FTViewController.m
- (void)viewDidLoad
{
[super viewDidLoad];
FTTest *test = [[FTTest alloc] init];
[test testmeup];
}
FT测试:
#import <MessageUI/MessageUI.h>
@interface FTTest : UIViewController <MFMailComposeViewControllerDelegate>
@implementation FTTest
- (void)testmeup
{
BOOL ok = [MFMailComposeViewController canSendMail];
if (!ok)
return;
MFMailComposeViewController* vc = [MFMailComposeViewController new];
vc.mailComposeDelegate = self;
[self presentViewController:vc animated:YES completion:nil];
}