Suitable key for NSDictionary
问题 Is there a way to determine if a class is suitable as a key and will work as you expect, for example I want to use NSIndexPath as a key in NSDictionary but I don't know for certain if two different NSIndexPath instances with the same integer values will always return the same hash value. 回答1: Apple's NSObject's isEqual document says: If two objects are equal, they must have the same hash value. This last point is particularly important if you define isEqual: in a subclass and intend to put