I made a custom logging class that logs certain things to a file. I'm trying to make a macro so that I can use my custom class just like
#define ECLog(fmt, ...) [ECLogger logText:fmt, ## __VA_ARGS__]
+ (void)logText:(NSString *)theString;
No, the warning is about the method call. The error seems to be about the macro because you're viewing the code before the preprocessor has worked on it, but the compiler's pointing to the same line, post-processing.
You've declared this method as taking one argument, but you're passing it more than that.
ECLog(@"test %@", someString);
gets rewritten by the preprocessor to:
[ECLogger logText:@"test %@", someString];
That's the literal text that is now passed to the compiler, just as if you'd typed it that way yourself. The method is declared as taking a single
NSString, but you're passing it two things. You need to change the declaration of the method:
+ (void) logText: (NSString *)theString, ...;