you're calling a class method, and declaring an instance method:
instance method:
- (double)getVarious:(eGetVarious)eVar:(NSDate*)pDate;
class method (may not use ivars or instance methods):
+ (double)getVarious:(eGetVarious)eVar:(NSDate*)pDate;
say you want this as an instance method, declare it like this:
- (double)getVarious:(eGetVarious)eVar forDate:(NSDate*)pDate;
and if you were in the scope of implementation of an instance method, then this should work:
double result = [self getVarious:eGetVarious1 forDate:[NSDate date]];
note the reason compiler is reporting an error:
if it has not seen a particular objc selector and you use it, it assumes the undeclared selector's arguments take id (anonymous objc object).
also, enum type should not be promoted to a pointer (although 0
is ok). since the compiler saw no way to match what you're calling: [objc_class* getVarious:eGetVarious<enum_type> :NSDate*]
it is right, because you should be calling it as:
General * anInstanceOfGeneral = /* something here */;
NSDate * date = /* something here */;
double result = [anInstanceOfGeneral getVarious:eGetVarious1 forDate:date];