I'm a bit new to Cocoa and I was reading about NSIndexSet
. Why is it necessary? It seems to me that NSIndexSet
is nothing but a NSSet
of integers, is that right? What's the purpose of creating a separate collection alltogether?
There are a couple reasons:
NSIndexSet
stores unsigned integer primitive types, whereas NSSet
stores objects.NSIndexSet
is optimized for storing unsigned integers, specifically a set of integers into another data structure like an NSArray
.