推荐哈希函数覆盖NSObject的哈希方法 [英] Recommended hash function for overwriting NSObject's hash method
本文介绍了推荐哈希函数覆盖NSObject的哈希方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
这是一个很好的社区wiki页面讨论覆盖函数实现-hash / -isEqual:/ -isEqualTo .. 。:对于Objective-C集合。
其中一个链接文章有一个实现覆盖isEqual:和hash 的最佳实践。
What's a good hash function for overwriting NSObject's hash method in your custom classes?
解决方案
Here is a good community wiki page discussing overwriting the functions Implementing -hash / -isEqual: / -isEqualTo...: for Objective-C collections.
And there is an implementation on one of the linked articles Best practices for overriding isEqual: and hash.
这篇关于推荐哈希函数覆盖NSObject的哈希方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文