When I try to invoke an instance of a class that implements a particular protocol, I get warnings about the method not being found in the protocol's signature.
warning: '-requestCompleted:requestType:' not found in protocol(s) warning: 'NSObject' may not respond to '-requestCompleted:requestType:'
I couldn't see the reason for this warning so I copied these classes with no changes into a separate project. When I build the new project, no warnings are generated.
When I execute the code in the original project, everything works fine -- it's just that warnings are shown during the build and I want them to go away.
I've already tried cleaning up my build targets and removing the files in the build directory. What am I not seeing that's causing the warning?
// file one
@protocol ResponseProtocol
- (void)requestCompleted:(NSDictionary *)responseData requestType:(ConnRequestType)lastRequestType;
@end
How I'm calling it:
@interface BaseClass : NSObject
__weak NSObject <ResponseProtocol> *delegate;
}
- (void)doSomething;
@end
@implementation BaseClass
- (void)doSomething
{
SEL aSelector = @selector(requestCompleted:requestType:)
if ((delegate != nil) && [delegate respondsToSelector:aSelector])
{
ConnRequestType aRequestType = ...;
NSDictionary *aResponseData = [NSDictionary dictionary];
// the following line generates the warnings:
[delegate requestCompleted:aResponseData requestType:aRequestType];
}
}
@end