I have warning on with error message below. Please help.
Assigning to 'id<MFMailComposeViewControllerDeelegate>' from incompatible type 'MyViewController'
and
Class 'MyViewController' does not implement the 'MFMailComposeViewControllerDelegate' protocol
The code is
-(void)displayComposerSheet
{
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
//below bold code is warning
**picker.mailComposeDelegate = self;**
[picker setSubject:@"My first apps!"];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObjects: nil];
[picker setToRecipients:toRecipients];
[picker setMessageBody:TextView.text isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];
}
The problem is as the error says: your class
MyViewControllerdoesn’t conform to theMFMailComposeViewControllerDelegateprotocol. Your interface line should look something like this:And, of course, you should be sure to implement
mailComposeController:didFinishWithResult:error:in your class.