Hi all,
In my application, I need to return the "Class" as a return type like:
Application.m:
+ (Class)getParserClass {
return [NCCurrencyParser class];
}
NCCurrencyParser.m:
@interface NCCurrencyParser NSObject <NCParser>
@protocol NCParser
+(NSNumber *)parserNumber:(NSNumber *)number;
in the caller method:
Class parserClass = [Application getParserClass];
[parserClass parserNumber:1.0];
But then the compiler gives me the error that parserClass may not respond to parseNumber. How can I force the Class have to adopt to some protocol like : Class <NCParser>
(but it doesn't work)