« Apple Store Refund
Über das File Sharing in Mac OS X... »
Samstag, 8. Januar 2005
Iterating over an NSIndexSet
Since I needed this quite a lot and the original Apple documentation isn't very helpful here, I decided to post my 2 favorite ways of iterating over an
// easy and still reasonable fast - can be reversed by using lastIndex and indexLessThanIndex:
index = [indexSet
// do Stuff
This seems a little bit inefficient, but I was made belief (by
behaves efficient when called this way.
Nevertheless if you want full speed at possibly large sets, then go for this one:
// more complex but as efficient as you choose your buffersize
// do stuff
If you know a way to reverse the direction of this one please add a comment.
20:26 - Samstag, 8. Januar 2005