iphone - Xode build warning and "method not found in protocol" when method signature does exist -
when try invoke instance of class implements particular protocol, warnings method not being found in protocol's signature.
warning: '-requestcompleted:requesttype:' not found in protocol(s) warning: 'nsobject' may not respond '-requestcompleted:requesttype:'
i couldn't see reason warning copied these classes no changes separate project. when build new project, no warnings generated.
when execute code in original project, works fine -- it's warnings shown during build , want them go away.
i've tried cleaning build targets , removing files in build directory. not seeing that's causing 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]; // following line generates warnings: [delegate requestcompleted:aresponsedata requesttype:arequesttype]; } } @end
make sure importing proper header file in baseclass.h file:
#import "responseprotocol.h"
Comments
Post a Comment