I'm trying to create an NSDictionary that uses key based upon the contents of a NSSet (specifically a set of NSManagedObjectID's). I'm currently at a bit loss as to how to do it. My various attempts at a hash based solution (see below) don't appear to be working.

Are you creating a map from the NSSet to something else? An NSMapTable may be more appropriate.

A note on your pasted code:
NSString *hashFromCharacteristicTypes = [NSString stringWithFormat: [[NSNumber numberWithInteger:hashInt] stringValue]];

NSDictionary keys can be any object that adheres to NSCopying, so you don’t need to convert the number to a string before placing it in the dictionary.

(In fact, you can make the set the key, but I have a feeling you probably don’t want to copy the set.)

-Ben_______________________________________________

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 arch...@mail-archive.com

Reply via email to