views:

30

answers:

1

Hi everyone,

I have a NSMutableDictionary, and my keys are objects (and the class implement the NSCopying protocol).

I add a value in the dictionary associated to a key, then, when I call the objectFoKey: method for the key which is in the dictionary, randomly, sometimes the method call "isEqual" and the key is found, and sometimes, the method "isEqual" is not called and the key is not found.

I can understand I do something wrong and the key is not found, but why sometimes the key is found but not always ?

Thank you very much if you have some hints to fix that problem, it becomes to make me crazy.

+1  A: 

Oups, ok, I found my mistake:

I must implement the hash method, that I didn't do.

Toto