-
-
Save xdream86/8541558 to your computer and use it in GitHub Desktop.
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
#ifndef RSNSMutableIndexSetMake | |
#ifndef RSNSIndexSetMake | |
#define RSNSMutableIndexSetMake(INDEXES...) \ | |
({ \ | |
NSUInteger indexes[] = {INDEXES}; \ | |
NSUInteger count = sizeof(indexes)/sizeof(NSUInteger); \ | |
NSMutableIndexSet *mutableIndexSet = [NSMutableIndexSet indexSet]; \ | |
for (int i = 0; i < count; ++i){ \ | |
[mutableIndexSet addIndex:indexes[i]]; \ | |
} \ | |
mutableIndexSet; \ | |
}) | |
#define RSNSIndexSetMake(INDEXES...) \ | |
({ \ | |
[[NSIndexSet alloc] initWithIndexSet:RSNSMutableIndexSetMake(INDEXES)]; \ | |
}) | |
#endif | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment