Search code examples
iphoneobjective-cxcodemfmailcomposeviewcontrollerios5

iOS 5.0: MFMailComposeViewController Warning


Since I updated XCode for the new iOS 5.0 i get a warning in my MailComposer function.

 MFMailComposeViewController *pickerZap = [[MFMailComposeViewController alloc] init];
 pickerZap.mailComposeDelegate = self;
 // warning: Assigning to 'id<MFMailComposeViewControllerDelegate>' 
 // from incompatible type 'Infocontroller *'

What happend with the MFMailComposeViewControllerDelegate? What am i doing wrong?


Solution

  • We can't really answer questions about iOS 5 without breaking the NDA.

    But what this looks like is that your class (Infocontroller) doesn't formally implement the delegate protocol (MFMailComposeViewControllerDelegate), i.e.,

    @class Infocontroller : UIViewController<MFMailComposeViewControllerDelegate>
    

    Just implementing the methods isn't enough.