My in app email is now working, but i’m getting a compile warning. I would like to fix this, any help or suggestions would be appreciated.
I’m getting this warning.
/Users/vikings1201/Documents/iPhone Applications/LittleTipper_4.0/tipApp/Classes/tipAppViewController.m:1083:0 /Users/vikings1201/Documents/iPhone Applications/LittleTipper_4.0/tipApp/Classes/tipAppViewController.m:1083: warning: class ‘tipAppViewController’ does not implement the ‘MFMailComposeViewControllerDelegate’ protocol
-(IBAction)sendMail {
MFMailComposeViewController *mailComposer = [[[MFMailComposeViewController alloc] init] autorelease] ;
mailComposer.mailComposeDelegate = self;
if ([MFMailComposeViewController canSendMail]) {
[mailComposer setToRecipients:nil];
[mailComposer setSubject:nil];
[mailComposer setMessageBody:@"Default text" isHTML:NO];
[self presentModalViewController:mailComposer animated:YES];
}
}
- (void)mailComposeController:(MFMailComposeViewController*)controller
didFinishWithResult:(MFMailComposeResult)result
error:(NSError*)error {
[controller dismissModalViewControllerAnimated:YES];
}
It’s trying to protect you from setting the
.delegateproperty to an object that might not implement the delegate methods.In your .h file, you need to make it declare that it implements the delegate protocol.