Re: NSIndexSet
Re: NSIndexSet
- Subject: Re: NSIndexSet
- From: Jean-Daniel Dupas <email@hidden>
- Date: Fri, 21 Nov 2008 16:53:44 +0100
Le 21 nov. 08 à 16:44, David Blanton a écrit :
How would one construct an NSIndexSet containing the indices 2,4,5 ?
I did:
NSRange two = NSMakeRange(2, 1);
NSRange four = NSMakeRange(4, 1);
NSRange five = NSMakeRange(5, 1);
NSRange u1 = NSUnionRange(two,four);
NSRange u2 = NSUnionRange(u1,five);
id indices = [NSIndexSet indexSetWithIndexesInRange:u2];
But, of course, NSUnionRange adds 3 so indices becomes 2,3,4,5.
Or, should one even use NSIndexSet?
Yes and no, It should use an NSMutableIndexSet.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden