Object keys with NSMutableDictionary (Objective-C)
I want to store a bunch of key value pairs, with the key being my own object (ObjectA) that inherits from NSObject, and the value being an int. I am trying to use an NSMutableDictionary. I understand that you can only store object types in the dictionary, so I have the following: id value = [NSNumber numberWithInt:my_number]; [[self dictionary] setObject:value forKey:myObjectA]; Now that gives me an error, saying -[ObjectA copyWithZone:]: unrecognized selector sent to instance which is fine, I understand that object keys need to implement the NSCopying protocol. However I then read that you