Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8210239
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:00:33+00:00 2026-06-07T10:00:33+00:00

– (void) showMail { [[CCDirector sharedDirector] pause]; NSString*myemail=@sirano0629@me.com; NSArray*email=[[NSArray alloc]initWithObjects:myemail, nil]; if([MFMailComposeViewController canSendMail]) {

  • 0
- (void) showMail
{
    [[CCDirector sharedDirector] pause];
    NSString*myemail=@"sirano0629@me.com";
    NSArray*email=[[NSArray alloc]initWithObjects:myemail, nil];
    if([MFMailComposeViewController canSendMail])
    {
        mail = [[MFMailComposeViewController alloc] init];
        [mail setSubject:[NSString stringWithFormat:@"건의 및 문의"]];
        [mail setToRecipients:email];
        [self presentModalViewController:mail animated:YES];
        [mail release];
    }
}



- (void)mailComposeController:(MFMailComposeViewController *)controller                   didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
    [mail dismissModalViewControllerAnimated:YES];
    mail.view.hidden=YES;
    [[CCDirector sharedDirector] resume];
    //return to previous scene
    [[CCDirector sharedDirector] replaceScene:[HelloWorldLayer scene]];
}

here is my code for email integration within app. First that opens email view is successfully but after I press send or cancel, the view has not going away…

can u guys please help to go throw it…

@class SingletonClass;

@interface GameCenterView : UIViewController     <GKLeaderboardViewControllerDelegate,MFMailComposeViewControllerDelegate>
{
SingletonClass * singleCurrentAverage;
MFMailComposeViewController*mail;
NSInteger score;
}


-(void)showLeaderboard;
-(void)showTweetForUnder;
-(void)showTweetForPost;
-(void)showMail;
@end

header file that I use

#import "GameCenterView.h"
#import "GameCenterUtil.h"
#import "HelloWorldLayer.h"
#import "SingletonClass.h"
#import "AppDelegate.h"
#import <MessageUI/MessageUI.h>

@interface GameCenterView ()

@end

@implementation GameCenterView


- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
    // Custom initialization
    if ([GameCenterUtil isGameCenterAPIAvailable]) {
        [GameCenterUtil authenticateLocalPlayer];
    }else {
        NSLog(@"this device do not support GameCenter");
    }

}
return self;
}
-(void)showLeaderboard
{
self.view.hidden=NO;

GKLeaderboardViewController * leaderboardController = [[[GKLeaderboardViewController alloc]init]autorelease];
if (leaderboardController!=nil) {
    leaderboardController.leaderboardDelegate=self;

    [self presentModalViewController:leaderboardController animated:YES];

}
}
-(void)showTweetForUnder
{
singleCurrentAverage=[SingletonClass sharedGameStateInstance];
score=[singleCurrentAverage currentAverage];
if([TWTweetComposeViewController canSendTweet]) {
    TWTweetComposeViewController*tweet=[[TWTweetComposeViewController alloc]init];
    [tweet setInitialText:[NSString stringWithFormat:@"대학교 점수 :%d from 성적UP iOS. \n 친구들에게 하고싶은 말을 적으세요.",score]];
    NSURL*url=[NSURL URLWithString:@"http://www.facebook.com/avoidpoo"];
    [tweet addURL:url];
    UIImage *image=[UIImage imageNamed:@"Icon-72.png"];
    [tweet addImage:image];
    [self presentModalViewController:tweet animated:YES];
} 
}

-(void)showTweetForPost
{
singleCurrentAverage=[SingletonClass sharedGameStateInstance];
score=[singleCurrentAverage currentAverage];
if ([TWTweetComposeViewController canSendTweet]) {
    TWTweetComposeViewController*tweet=[[TWTweetComposeViewController alloc]init];
    [tweet setInitialText:[NSString stringWithFormat:@"대학원 점수: %d from 성적Up iOS. \n 친구들에게 하고 싶은 말을 적으세요.",score]];
    NSURL*url=[NSURL URLWithString:@"http://www.facebook.com/avoidpoo"];
    [tweet addURL:url];
    UIImage *image=[UIImage imageNamed:@"Icon-72.png"];
    [tweet addImage:image];
    [self presentModalViewController:tweet animated:YES];

}
}
- (void) showMail
{
mail.mailComposeDelegate=self;
NSString*myemail=@"sirano0629@me.com";
NSArray*email=[[NSArray alloc]initWithObjects:myemail, nil];
if([MFMailComposeViewController canSendMail]) {
    mail = [[MFMailComposeViewController alloc] init];
    [mail setSubject:[NSString stringWithFormat:@"건의 및 문의"]];
    [mail setToRecipients:email];
    [self presentModalViewController:mail animated:YES];
    [mail release];
}
} // From Here You can Dismisses the email composition interface when users tap Cancel or Send. 
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
{   
// Notifies users about errors associated with the interface
switch (result)
 {
    case MFMailComposeResultCancelled:
        NSLog (@"Result: canceled");
        break;
    case MFMailComposeResultSaved:
        NSLog (@"Result: saved");
        break;
    case MFMailComposeResultSent:
        NSLog (@"Result: sent");
        break;
    case MFMailComposeResultFailed:
        NSLog (@"Result: failed");
        break;
    default:
        NSLog (@"Result: not sent");
        break;
}
[self dismissModalViewControllerAnimated:YES];
}
-(void) leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController
{
[self dismissModalViewControllerAnimated:YES];

self.view.hidden =YES;

}


-  (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view.
}

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end

this is my implemenation file

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T10:00:36+00:00Added an answer on June 7, 2026 at 10:00 am

    You have to set Your Controller as delegate for MFMailComposeViewController like

    if([MFMailComposeViewController canSendMail]) {
        mail = [[MFMailComposeViewController alloc] init];
    
        mail.mailComposeDelegate = self; //<-- Add this line
    
        [mail setSubject:[NSString stringWithFormat:@"건의 및 문의"]];
        [mail setToRecipients:email];
        [self presentModalViewController:mail animated:YES];
        [mail release];
    }
    

    And than you have to implement following delegate method. Thats it.

       // From Here You can Dismisses the email composition interface when users tap Cancel or Send. 
        - (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error 
        {   
        // Notifies users about errors associated with the interface
        switch (result)
        {
            case MFMailComposeResultCancelled:
                NSLog (@"Result: canceled");
                break;
            case MFMailComposeResultSaved:
                NSLog (@"Result: saved");
                break;
            case MFMailComposeResultSent:
                NSLog (@"Result: sent");
                break;
            case MFMailComposeResultFailed:
                NSLog (@"Result: failed");
                break;
            default:
                NSLog (@"Result: not sent");
                break;
        }
        [self dismissModalViewControllerAnimated:YES];
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
My NSXMLParser breaks on this string: <title>AAA &#8211; BCDEFGQWERTYUIO</title> I parsed it in this
I would like to count the length of a string with PHP. The string
I've got the following login script.. <?php $name = $_POST[name]; $password = $_POST[password]; $query
So to start, I have an array of XML files. These files need to
I'm struggling to position the second level of a dropdown nav menu and was
Have a webpage that will be viewed by mainly IE users, so CSS3 is
I'm trying to craft a Java regular expression to split strings of the general
Welcome to Spring Roo. For assistance press CTRL+SPACE or type hint then hit ENTER.
I am reading some og tags from sites but I can't seem to decode

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.