开发者

Problems with CoreDataBooks Example from Apple

I am currently playing with CoreData and have a problem with the CoreDataBooks Example from Apple.

Basically I just wanted to extend the data model. I updated the model class aswell and no compiler error, butr a crash when I want to start the example.

Unresolved error Error Domain=NSCocoaErrorDomain Code=134130 UserInfo=0x1316ce0 "Operation could not be completed. (Cocoa error 134130.)", { URL = file://localhost/.../CoreDataBooks.sqlite; ...some nonsense info ... reason = "Can't find model for source store"; }

Do I need to updat the sqlite database ?开发者_运维知识库

Thanks


Whenever you modify or update the data model, make sure you:

  1. Add NSManagedObject class header and implementations for any new or modified entities (select the entity in the data modeler and use New File... > NSManagedObject to create new class files).

  2. Delete your app from the iPhone simulator or device, before rebuilding and reinstalling. You can worry about migration issues later.


Anyway, I needed to version the datamodel before changing anything that would ensure that the model does migrate automatically.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜