简体   繁体   English

轻量级迁移时我的应用程序崩溃

[英]My app crashes when lightweight Migration

I have created a new version of Core Data Model with a non-optional 'new attribute'. 我创建了带有非可选“新属性”的新版本的核心数据模型。 When I run my app in previous build. 当我在以前的版本中运行我的应用程序时。 My app crashes. 我的应用崩溃了。

can you give me any suggestion? 你能给我什么建议吗?

Just set the default value of your 'new attribute'. 只需设置“新属性”的默认值即可。 If you don't set default value then the 'new attribute' will be assigned by a nil value which eventually crashes your app. 如果您未设置默认值,那么“新属性”将由nil值分配,最终会导致您的应用崩溃。

 NSString *yourAttribute = @"Default";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM