Question

I have multiple protocol in Xcode Project it will give error such like this. help me Error Like :-> Cannot find Protocol declaration for 'ButtonDelegate' did you mean 'CustomDelegate'? Thanks in AdvanceImage

Delegate Header File

#import <UIKit/UIKit.h>
#import "Constant.h"

@protocol ButtonDelegate <NSObject>
-(void)ChatButtonClicked;
@end

@interface DonttreadonmeCell : UITableViewCell<UIGestureRecognizerDelegate,UITextViewDelegate>{

id <ButtonDelegate> Buttondelegate;

 .h File

#import <UIKit/UIKit.h>
#import <Twitter/Twitter.h>
#import "JSONParsing.h"
#import "Facebook.h"
#import "DonttreadonmeCell.h"
#import "Constant.h"



 @class DonttreadonmeCell;

    @interface BookTextPeregraphselectedViewController :   UIViewController<MFMailComposeViewControllerDelegate,FBSessionDelegate,FBRequestDelegate,ButtonDelegate,FBLoginDialogDelegate,FBDialogDelegate,JSONParsingDelegate,UITableViewDataSource,UITableViewDelegate,UIGestureRecognizerDelegate,UITextViewDelegate>{
Was it helpful?

Solution

I declared my protocol declaration section in top of the import file... it worked thank God.

  @protocol ButtonDelegate <NSObject>
-(void)ChatButtonClicked;
@end


#import <UIKit/UIKit.h>
#import "Constant.h"

Like this

OTHER TIPS

Include header file related to particular missing protocol. In my case it was MFMailComposeViewControllerDelegate. I added

#import <MessageUI/MessageUI.h>

Problem fixed.

These 2 imports solved my problem. Please try it.

#import <MessageUI/MessageUI.h>
#import <MessageUI/MFMailComposeViewController.h>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top