<分区>
标签 ios objective-c xcode realm
<分区>
当我调试应用程序时,我添加了一个新属性 (@property NSString *haha;),但它显示以下异常:
Terminating app due to uncaught exception 'RLMException', reason: 'Migration is required due to the following errors:
- Property 'haha' has been added to latest object model.'
但是当我添加 ignoredProperties 时,效果很好:
+ (NSArray *)ignoredProperties {
return @[@"thead"];
}
为什么?谢谢。
最佳答案
当您的应用上线/启动时,您需要在更改数据库模型时进行迁移。可以引用Realm的migration docs
与此同时,我相信您仍在开发您的应用程序。您可以从您的模拟器或设备中删除/卸载并重新运行您的代码
关于ios - 'RLMException',原因 : 'Migration is required due to the following errors,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38343366/