How do I respond to this warning?
warning: duplicate protocol definition "..." is ignored
The declaration of my protocol is in its own .h file, and it is # imported into several other files in my project.
Well, just in case, here is 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
Thanks for any advice.
Make sure you don’t have a header file added to the project twice, or two different files that both implement the protocol. This is what caused the warning to me.
, . Xcode. Xcode, 2 . . .
, .
, . , , , , .
.
, , #import , . , #include, , ?
#import
#include
#import . , , , , . MyLibrary.h, , , Xcode .
MyLibrary.h
- include/$(TARGET_NAME) - .
include/$(TARGET_NAME)
- , MyLibrary.h. .
TL;DR: . , , , .
, ,