处理CoreData和可选类型的目标C中的新特性
我与Coredata合作,提出了一些我无法通过研究回答的问题。假设我已经开发了一个应用程序,并且使用Coredata进行持续存储。现在,我想更新该应用程序并将属性添加到实体。我认为最好的解决方案是使新属性可选,以使现有实例没有问题,您是否同意?另一件事是,当我尝试时,我注意到INT16?不允许,因为它与Objective-C不起作用。但是作为替代方案,nsnumber?作品,我不喜欢它。您如何做,最佳实践是什么样的?
I work with CoreData and I came up with some questions that I could not answer through research. Let's assume I have developed an app and the persistent storage is done with CoreData. Now I want to update the app and add a property to an entity. I think the best solution is to make the new property optional so that there are no problems with the existing instances, do you agree? Another thing is that when I try, I noticed the int16? not allowed because it does not work with objective-c. But as an alternative, NSNumber? works, which I somehow don't like. How do you do it and what does the best practice look like?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论