不实现该功能有什么优点或缺点吗?
我知道一些solutions存在并且它在路线图上,但是该决定背后是否有任何我们没有授予的优势?
最佳答案
在 Github 上的讨论中(参见 realm/realm-cocoa#2591 ),Realm 团队表示没有计划支持任何自动增量字段,即使开发人员可以使用几行代码来实现您所说的此功能。
来自讨论中的 Realm 成员:
We decided that we're not going to support this feature, because we would be unable to support it with simultaneous access from multiple processes.
就是这样。
关于realm - 为什么Realm不支持自增主键?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40289738/