TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Jonathan Crooke.
Stop using constant NSStrings to represent your keypaths: use compiler symbols instead.
Super simple extension to Justin Spahr-Summers' object key path validation macro that adds a macro for validating key paths without requiring an instance of the class.
Particularly useful for removing constant NSStrings
from your API mappings.
JCValidateKeyPath(anObject, aKeyPath)
NSString
representation.JCValidateKeyPathWithClass(aClass, aKeyPath)
Class
directly.Examples:
// With a local instance
NSString *stringInstance = nil;
JCValidateKeyPath(stringInstance, length);
// Without a local instance
JCValidateKeyPathWithClass(NSString, length)
Note that as of v1.0.1 you cannot use JCValidateKeyPathWithClass([NSString class], length)
. Instead you must use the class symbol directly.
v1.1.0
Cache now removed and functionality entirely implemented with macros. Many thanks to Stepan Hruda for this.
v1.0.2
General spring-clean and Travis configuration.
v1.0.1
Now casting the object returned from the cache. Without this, class validation wasn't actually correctly working; you could use any valid selector from any class.
v1.0.0
Initial release.