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];
}