Last Updated: February 25, 2016
·
1.567K
· rabovik

Easily creating NSIndexSet

There are no methods in NSIndexSet or NSMutableIndexSet for creating index sets with non-consecutive indexes.
Here are some macros for this: [github gist][gist].

Usage Example

NSIndexSet *indexSet = RSNSIndexSetMake(10,20,30,40,50);
NSMutableIndexSet *mutableIndexSet = RSNSMutableIndexSetMake(10,20,30);

[gist]: https://gist.github.com/rabovik/5894790