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
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 Advance
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>{
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>