Cannot find protocol declaration for "MFMailComposeViewControllerDelegate"; Did you mean "UIPageViewControllerDelegate"?

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 character: #import "MessageComposerViewController.h"

  • The expected identifier or '(' for this character: @interface MapViewController: UIViewController // Add a delegate and this character: {

Thanks for the promotion. :)

+4
source share
3 answers

Try it,

    #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
+4
source

Xcode, . , .

+1

, ios8. , , - , . , libAWDProtobufFacetimeiMessage - . , , , , . . , , .

0

All Articles