Creating iOS 5 Apps Discussion > Chap 6 - isEqual
Yes, those methods are required for the conflict resolution code to work properly. I'm not sure what happened to them. I think they were probably accidentally deleted somewhere along the way. Thanks for pointing that out. I'll upload a corrected version today.
As far as the hash method goes, you should always implement a custom hash method whenever you implement a custom isEqual: method. Basically, the problem is that whenever isEqual returns true, then hash should return the same value. By default, hash and isEqual are both based on the object's memory address--so no problems. But, now that we're letting objects at different memory addresses be equal, we also need to make sure they produce the same hash.
If we don't do this, we'll get really odd bugs whenever we try to store our objects in containers that rely on the hash value (e.g. dictionaries). Of course, this probably won't affect the HealthBeat application as currently written, but it's a good habit to get into. You never know when you might modify the application in the future.

When opening the downloaded source from chapter 6 I noticed that the methods isEqual: and hash, as described at page 316 of the book, are not in the source. They should be right?
I do not understand why, after implementing the isEqual:method you also need to implement the hash method?
Should isEqual: not be enough? What we want to implement here is: "My objects are equal when their properties match", nothing more.
Kind regards,
Bas