ios - 'RLMException',原因 : 'Migration is required due to the following errors

标签 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/

上一篇:ios - Crashlytics 安装 - 停留在验证安装第 2 步(共 2 步)

下一篇:iOS 10 Collection View :prefetchItemsAt not called

相关文章:

ios - 在 ionic ios 应用程序的输入文本字段中消失光标指针

iphone - 使用新行格式化 plist 字典中的字符串

ios - 弹出窗口推送时改变 TintColor

objective-c - Cocos2d 菜单未注册触摸

objective-c - 更改 header 信息二进制并将其写回

iOS 9 无法播放下载到设备的音频/视频文件

ios - 使用 AVFoundation,如何从视频的所有帧中删除中间 400 像素

ios - 如何快速地为具有内部类型的协议(protocol)定义类型

ios - swift Storyboard : changing a two column layout to a multiple column layout

ios - 通过目标成员身份而不是目录指定 Cocoapod 源文件