cocoamacosnsindexset

Fast enumeration on an NSIndexSet


Can you fast enumerate a NSIndexSet? if not, what's the best way to enumerate the items in the set?


Solution

  • Fast enumeration must yield objects; since an NSIndexSet contains scalar numbers (NSUIntegers), not objects, no, you cannot fast-enumerate an index set.

    Hypothetically, it could box them up into NSNumbers, but then it wouldn't be very fast.