gpt4 book ai didi

ios - 当我单击取消时,电子邮件 Composer 不会返回

转载 作者:行者123 更新时间:2023-11-29 03:31:25 25 4
gpt4 key购买 nike

所以这是我的问题,我在 Twitter 和 Facebook 中添加了一个操作表,工作正常,但是当我在电子邮件编辑器中添加时,应用程序似乎无法返回到原始屏幕并停留在电子邮件编辑器中.

 - (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {

//Each button title we gave to our action sheet is given a tag starting with 0.
if (buttonIndex == 0) {

//Check Twitter accessibility and at least one account is setup.
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) {

SLComposeViewController *tweetSheet =[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];

//This is setting the initial text for our share card.
[tweetSheet setInitialText:@"Switcher makes social networking easier, download it now from (LINK):D "];

//Brings up the little share card with the test we have pre defind.
[self presentViewController:tweetSheet animated:YES completion:nil];

} else {
//This alreat tells the user that they can't use built in socal interegration and why they can't.
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sorry" message:@"You can't send a tweet right now, make sure you have logged into twitter aleady from your iphone settings." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
}

}else if (buttonIndex == 1) {

//Check Facebook accessibility and at least one account is setup.
if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook]) {

SLComposeViewController *facebookSheet =[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

//This is setting the initial text for our share card.
[facebookSheet setInitialText:@"Switcher makes social networking easier, download it now from (LINK) :D "];

//Brings up the little share card with the test we have pre defind.
[self presentViewController:facebookSheet animated:YES completion:nil];

} else {
//This alreat tells the user that they can't use built in socal interegration and why they can't.
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Sorry" message:@"You can't send a post right now, make sure you have logged into facebook aleady from your iphone settings" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alertView show];
}

}else if (buttonIndex == 2) {

MFMailComposeViewController *mailContoller = [[MFMailComposeViewController alloc]init];
[mailContoller setMailComposeDelegate:self];
NSString *email = @"";
NSArray *emailArray = [[NSArray alloc]initWithObjects:email,nil];
NSString *message = @"hey download my application now";
[mailContoller setMessageBody:message isHTML:NO];
[mailContoller setToRecipients:emailArray];
[mailContoller setSubject:@""];
[self presentViewController:mailContoller animated:YES completion:nil];





}

最佳答案

您需要实现MFMailComposeViewControllerDelegate方法。您需要在该方法中自行关闭邮件编辑器。

- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
[self dismissViewControllerAnimated:controller completion:nil];
}

关于ios - 当我单击取消时,电子邮件 Composer 不会返回,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19733965/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com