【发布时间】:2013-09-21 05:17:34
【问题描述】:
我在 Xcode 项目中有多个协议,它会给出这样的错误。帮我 类似错误:-> 找不到“ButtonDelegate”的协议声明您的意思是“CustomDelegate”吗? 提前致谢
委托头文件
#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>{
【问题讨论】:
-
我看不懂。发布文本。
-
@H2CO3 错误:找不到“ButtonDelegate”的协议声明您的意思是“CustomDelegate”吗
-
您是否导入了声明协议的 .h 文件?
-
@Bhargavi 是的,我正确导入了 .h 文件,我检查了两次
-
阅读How do I create delegates in Objective-C? 我认为你犯了一个非常简单的错误。
标签: iphone ios xcode4.5 protocols