【发布时间】:2018-09-27 20:17:43
【问题描述】:
我有以下枚举:
enum MyEnum {
case One
case Two
case Three
}
但是当我打印这一行时:
print("This is the hash value of One \(MyEnum.One.hashValue)")
我得到以下输出:
This is the hash value of One -7827947590157343570
如果我重新运行我得到的代码:
This is the hash value of One 7980945707037922449
我应该得到这样的东西: 这是One 0的哈希值
我的问题是为什么我得到随机数?
非常感谢您的帮助。
【问题讨论】: