Created
September 1, 2013 19:58
-
-
Save rustle/6406932 to your computer and use it in GitHub Desktop.
Example of the kind of thorough checks you can do in asserts that would be too expensive to leave in production code
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
#if !defined(NS_BLOCK_ASSERTIONS) | |
#define RSTLSetOfStringsAssert(set) [set enumerateObjectsUsingBlock:^(id obj, BOOL *stop) { NSParameterAssert([obj isKindOfClass:[NSString class]]); }]; | |
#else | |
#define RSTLSetOfStringsAssert(set) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment