Cannot find protocol declaration for 'MFMailComposeViewControllerDelegate'; did you mean 'UIPageViewControllerDelegate'?

ios, xcode

Solution

Try This,

    #import <UIKit/UIKit.h>
    #import <MapKit/MapKit.h>
    #import <MessageUI/MessageUI.h>
    #import "MessageComposerViewController.h"
    #import <MessageUI/MFMailComposeViewController.h>

    @interface MapViewController : UIViewController <MFMailComposeViewControllerDelegate,UINavigationControllerDelegate> {
      IBOutlet MKMapView *mapView;
   }
    - (IBAction)showEmail:(id)sender;
    @property (nonatomic, retain) MKMapView *mapView; 
    @end

Problem

This code : ``` #import <UIKit/UIKit.h> #import <MapKit/MapKit.h> #import <MessageUI/MessageUI.h> #import "MessageComposerViewController.h" #import <MessageUI/MFMailComposeViewController.h> @interface MapViewController : UIViewController <MFMailComposeViewControllerDelegate> // Add the delegate - (IBAction)showEmail:(id)sender; { IBOutlet MKMapView *mapView; } @property (nonatomic, retain) MKMapView *mapView; @end ``` This problem or error : Cannot find protocol declaration for 'MFMailComposeViewControllerDelegate'; did you mean 'UIPageViewControllerDelegate'? for this lign : #import "MessageComposerViewController.h" Expected identifier or '(' for this lign : @interface MapViewController : UIViewController // Add the delegate and this lign : { Thanks for advance. :)

Original source