On Apr 7, 2008, at 5:33 AM, Paul Sargent wrote:
Can anybody suggest a good way to:
1) Given an ordered set of objects, create a new non-mutable ordered
set,
with all the duplicates removed?
You could do this using the KVC set and array operators (http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/ArrayOperators.html
):
NSArray *arr = [NSArray arrayWithObjects:@"A", @"A", @"B", @"B", @"C",
nil];
NSArray *arr2 = [arr valueForKeyPath:@"@distinctUnionOfObjects.self"];
- Wil
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]