Re: I can't figure out how to use NSIndexSet
Re: I can't figure out how to use NSIndexSet
- Subject: Re: I can't figure out how to use NSIndexSet
- From: Keith Renz <email@hidden>
- Date: Thu, 20 Nov 2003 21:58:34 -0500
Bill,
It appears NSIndexSet provides for both ways of getting the indices,
one at a time -- you can pick an index (which may or may not be in the
set) and start walking either way -- or en-masse. I am currently using
the en-masse method like you described for table selection mechanics
with excellent results. If you're going to iterate through a lot of
indexes, it sure seems more efficient to load them all into a buffer
and increment a pointer than invoke a method for each iteration. So, I
would suggest that Scott add sample code for both methods. NSIndexSet.h
also provides a very short explanation.
Keith
-----
On Nov 20, 2003, at 6:49 PM, Bill Cheeseman wrote:
on 2003-11-20 4:37 PM, Scott Anguish at email@hidden wrote:
while (currentIndex = != NSNotFound) {
I'll have to break out my Kernighan & Ritchie on that syntax! :-)
Seriously, how does this fit into what I was doing, as described in my
post
just now? Do your very Cocoa-like iteration skeletons automatically
handle
all the very C-like buffer declarations and calls to
getIndexes:maxCount:inIndexRange: in my code?
Or do your iteration skeletons assume some user setup that you didn't
describe?
Is my code all wet, or is it a good way to approach speed optimization
for
large index sets?
--
Bill Cheeseman - email@hidden
Quechee Software, Quechee, Vermont, USA
http://www.quecheesoftware.com
The AppleScript Sourcebook - http://www.AppleScriptSourcebook.com
Vermont Recipes - http://www.stepwise.com/Articles/VermontRecipes
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.