'id<MFMailComposeViewControllerDelegate>'from incompatible type 'ViewController *const_strong'
mfmailcomposeviewcontroller, objective-c, xcode
Solution
This warning says that you haven't told the compiler that your class `ViewController` implements the `MFMailComposeViewControllerDelegate` protocol.
If you haven't done it, implement all the required methods from that protocol. In your case it's only one (`– mailComposeController:didFinishWithResult:error:`).
After that you have to tell the compiler that your class implements this protocol. You do this by adding `<MFMailComposeViewControllerDelegate>` to the `@interface` of ViewController. (The interface is in your header file, ViewController.h).
Your interface should now look similar to this:
@interface ViewController : UIViewController <MFMailComposeViewControllerDelegate>
@property ...
@end
Problem
In my app I have a button that when pressed opens a email whit filled out "to" and "subject", but I get this warning on this line of code: ``` mc.mailComposeDelegate = self; ``` The warning says: `Assigning to 'id<MFMailComposeViewControllerDelegate>'from incompatible type 'ViewController *const_strong'` What do I do? Please be very clear, I am not too skilled in xCode.