Re: My new framwork
Re: My new framwork
- Subject: Re: My new framwork
- From: mmalcolm crawford <email@hidden>
- Date: Wed, 3 Mar 2004 13:49:32 -0800
On Mar 3, 2004, at 12:28 PM, Allan Odgaard wrote:
I'll just mention that in Panther, you can use -selectedRowIndexes to
get an NSIndexSet of the selection..
Which is a pain to iterate, so I'll just mention that with CocoaSTL
<http://www.top-house.dk/~aae0030/cocoastl/> you can iterate an
NSIndexSet like this:
NSIndexSet* indexSet = ...;
foreach(it, beginof(indexSet), endof(indexSet))
printf("%d\n", *it);
I am really puzzled that Apple does not provide a way to easily
iterate objects instantiated from this class...
This seems straightforward enough:
NSIndexSet * indexSet = ...;
Forwards:
unsigned currentIndex = [indexSet firstIndex];
while (currentIndex != NSNotFound)
{
//...
currentIndex = [indexSet indexGreaterThanIndex:currentIndex];
}
Backwards:
unsigned currentIndex = [indexSet lastIndex];
while (currentIndex != NSNotFound)
{
// ...
currentIndex = [indexSet indexLessThanIndex:currentIndex];
}
mmalc
_______________________________________________
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.