Skip to content

Instantly share code, notes, and snippets.

@jyliang
Created April 13, 2016 14:41
Show Gist options
  • Save jyliang/37f215cbf35d9047b6c2e6da1d0cecd7 to your computer and use it in GitHub Desktop.
Save jyliang/37f215cbf35d9047b6c2e6da1d0cecd7 to your computer and use it in GitHub Desktop.
SEL STRING
// PLRK_SEL_STRING is for specifying selector (usually property) names to KVC
// or KVO methods.
// In debug it will generate warnings for undeclared selectors if
// -Wunknown-selector is turned on.
// In release it will have no runtime overhead.
#ifndef PLRK_SEL_STRING
#ifdef Debug
#define PLRK_SEL_STRING(selName) NSStringFromSelector(@selector(selName))
#else
#define PLRK_SEL_STRING(selName) @#selName
#endif // Debug
#endif // PLRK_SEL_STRING
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment