gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-03 19:30:30 25 4
gpt4 key购买 nike

我已经在线搜索并通过我的代码进行搜索,但我无法弄清楚我的问题出在哪里。如果有人可以帮助我,我将不胜感激。

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 编程还很陌生。所以,还请大家原谅我没有完全理解这个问题。

最佳答案

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

incomplete implementation

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

关于iphone - 语义问题 - Xcode 实现不完整,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13091440/

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