语义问题 - 不完整的实现 Xcode

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13091440/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 01:57:08  来源:igfitidea点击:

Semantic Issue - Incomplete implementation Xcode

iphonexcodemacosios6

提问by user1777808

I have searched online and through my code and I can not figure out where my issue is. If someone could assist me I would greatly appreciate it.

我在网上和我的代码中搜索过,但我不知道我的问题出在哪里。如果有人可以帮助我,我将不胜感激。

SecondViewController.h

第二视图控制器.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

第二视图控制器.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 =@"[email protected]";
    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

I'm fairly new to programming for the iPhone. So, please excuse me for not fully understanding this issue.

我对 iPhone 编程还很陌生。所以,请原谅我没有完全理解这个问题。

回答by rob mayoff

Xcode will tell you what you're missing. Choose View > Navigators > Show Issue Navigator, then turn down all of the disclosure triangles:

Xcode 会告诉您缺少什么。选择“视图”>“导航器”>“显示问题导航器”,然后调低所有显示三角形:

incomplete implementation

执行不完整

Note that you declared a method named Contact:, but you implemented a method named Contact. The colon is part of the method name. You can't omit it.

请注意,您声明了一个名为 的方法Contact:,但您实现了一个名为 的方法Contact。冒号是方法名称的一部分。你不能省略它。