This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// See http://nshipster.com/key-value-observing/ | |
// Put this code a common utilities header, and use it to have the compiler help check correctness of key paths. | |
// Uses macro stringification to create an Obj-C string literal, plus validation code that the compiler optimizes out. | |
@interface NSObject (KeyPathFakeCategoryForCompilerWarnings) | |
+ (instancetype)__fake_method_for_compiler_warnings__; | |
- (instancetype)__fake_method_for_compiler_warnings__; | |
@end | |
/*! Returns a string for the given keypath, but causes a compiler warning if the keypath is not defined on \c self. |