3

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

#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 =@"[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.

0

1 Answer 1

11

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

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.

2
  • Thank you! Once I added that it still gave me the error. I think my main issue was because I didn't implement twitter or facebook in the .m. So by adding them and making there be no code between the {} my error went away. Oct 26, 2012 at 17:55
  • Wow, 3 years of iOS development and I never thought to press the arrow to see what the Semantic issue was incasing. +1 Jun 21, 2013 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.