Friday, October 9, 2009

Safe Key-Value-Coding

M. Uli Kusterer suggests using:

#if DEBUG
#define PROPERTY(propName)    NSStringFromSelector(@selector(propName))
#else
#define PROPERTY(propName)    @#propName
#endif

to define symbolic constants for keys so that the compiler will give you Undeclared Selector warnings.

Comments RSS · Twitter

Leave a Comment