Reputation: 12004
I'm trying to call the e-mail programme from my app. What I have done so far:
#import <MessageUI/MessageUI.h>
and added delegate:
@interface MyViewController : UIViewController <MFMailComposeViewControllerDelegate>
then I thought I'd be brave and put this into my code:
- (void)sendEmail {
MFMailComposeViewController *mailComposer;
mailComposer=[[MFMailComposeViewController alloc] init];
mailComposer.mailComposeDelegate=self;
[self presentModalViewController:mailComposer animated:YES];
[mailComposer release];
}
However, I only get an error message which I do not understand in the slightest. Could anyone please help me to interpret this? It doesn't make any sense to me and doesn't point to a line of code so I don't understand where to start when debugging:
Upvotes: 0
Views: 272
Reputation: 25692
I think you didn't add framework to your project MessageUI framework.
Upvotes: 1
Reputation: 5940
You need to #import the framework in your .m file
#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>
Upvotes: 2