警告:"..."的重复协议定义将被忽略 [英] warning: duplicate protocol definition of '...' is ignored

查看:260
本文介绍了警告:"..."的重复协议定义将被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我应该如何回应此警告?

How should I respond to this warning?

警告:"..."的重复协议定义将被忽略

warning: duplicate protocol definition of '...' is ignored

我的协议声明在其自己的.h文件中,并且#import在我项目的其他几个文件中.

My protocol declaration is in its own .h file, and it is #import'ed in a few other files in my project.

以防万一,这里是带有协议声明的整个头文件:

Well, just in case, here's the entire header file with the protocol declaration:

#import <Foundation/Foundation.h> 

@class Wrapper;

@protocol WrapperDelegate

@required
- (void)wrapper:(Wrapper *)wrapper didRetrieveData:(NSData *)data;

@optional
- (void)wrapperHasBadCredentials:(Wrapper *)wrapper;
- (void)wrapper:(Wrapper *)wrapper didCreateResourceAtURL:(NSString *)url;
- (void)wrapper:(Wrapper *)wrapper didFailWithError:(NSError *)error;
- (void)wrapper:(Wrapper *)wrapper didReceiveStatusCode:(int)statusCode;

@end

谢谢您的建议.

推荐答案

检查以确保没有两次在项目中添加头文件,或者没有两个都实现协议的文件.这就是导致警告出现在我身上的原因.

Check to make sure you don't have the header file added in your project twice, or two different files that both implement the protocol. This is what caused the warning to appear for me.

这篇关于警告:"..."的重复协议定义将被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆