use*_*808 3 iphone macos xcode ios6
我在线搜索并通过我的代码,我无法弄清楚我的问题在哪里.如果有人可以帮助我,我会非常感激.
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
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
我对iPhone的编程很新.所以,请原谅我没有完全理解这个问题.
rob*_*off 11
Xcode会告诉你你缺少什么.选择"视图">"导航器">"显示问题导航器",然后调低所有显示三角形:

请注意,您声明了一个名为的方法Contact:,但是您实现了一个名为的方法Contact.冒号是方法名称的一部分.你不能省略它.
| 归档时间: |
|
| 查看次数: |
6102 次 |
| 最近记录: |