Re: Abstracting a group of commonly named Selectors


Jeff Laing
 

You really haven't provided enough information about the caller, and you've skipped over the C programmers favourite answer. Presumably you actually NEED all those seperate selectors and can't just change the caller to call a common handler. Second, what's wrong with:

#define IMPLEMENT(m) -(mytype)parse##m { return [self parse:m]; }
IMPLEMENT(XYZ)
IMPLEMENT(ABC)

Join cocoa@apple-dev.groups.io to automatically receive all group messages.