首页 » iOS 开发 » Core Data; Cocoa error 134100

Core Data; Cocoa error 134100

作者: 低调的术木 分类: iOS 开发 发布时间: 2014-08-04 07:05 ė浏览 2,112 次 6没有评论

今天开发突然遇到这个问题

The operation couldn’t be completed. (Cocoa error 134100.)

http://stackoverflow.com/questions/5517129/core-data-cocoa-error-134100

查到这才发现是因为自己改了数据结构. 没有把之前 的数据库删除造成的.
把模拟器中的应用删除了再试次吧.

And here’s how you did it:

  1. You created some entities with some attributes and wrote some code
  2. Launched the app, probably added some content
  3. Quit the app and added/changed some more entities with attributes
  4. You probably launched the app again and now it’s giving you the error

The reason for this is because your new managed object model is trying to use older version of storage (the one first time created when you launched the app).

The quick and dirty fix would be to remove the storage file (somewhere in ~/Library/Application Support/YOUR_APP/) and to launch your app again.

For future reference – if you release an app and in next release the app has changed managed object model – you have to write migrations for it. All this and more is covered in core data programming cookbook in apple documentation.

本文出自 蓝天笔记,转载时请注明出处及相应链接。

本文永久链接: http://ubluesky.com/archives/490

发表评论

电子邮件地址不会被公开。 必填项已用*标注

您可以使用这些HTML标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Ɣ回顶部