オンラインでコードを検索しましたが、問題がどこにあるのかわかりません。誰かが私を助けることができれば、私はそれを大いに感謝します.
SecondViewController.h
#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>
@interface SecondViewController : UIViewController <MFMailComposeViewControllerDelegate>
{}
-(IBAction)twitter:(id)sender;
-(IBAction)facebook:(id)sender;
-(IBAction)Contact:(id)sender;
@end
SecondViewController.m
#import "SecondViewController.h"
@interface SecondViewController ()
@end
@implementation SecondViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(IBAction)Contact {
MFMailComposeViewController *mailcontroller = [[MFMailComposeViewController alloc] init];
[mailcontroller setMailComposeDelegate:self];
NSString *email =@"Warce@actionsportsinc.com";
NSArray *emailArray = [[NSArray alloc] initWithObjects:email, nil];
[mailcontroller setToRecipients:emailArray];
[mailcontroller setSubject:@"Enter Subject Here"];
[self presentViewController:mailcontroller animated:YES completion:nil]; }
-(void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error{ [self dismissViewControllerAnimated:YES completion:nil];
}
@end
私はiPhoneのプログラミングにかなり慣れていません。ですから、この問題を完全に理解していないことをお許しください。