Fast enumeration on an NSIndexSet

后端 未结 6 736
南旧
南旧 2020-12-14 14:13

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

6条回答
  •  渐次进展
    2020-12-14 14:38

    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.

提交回复
热议问题