您的位置:首页 > 移动开发 > Objective-C

“Core Data could not fulfill a fault” for objects that were not deleted

2015-06-30 20:53 441 查看


3down
voteaccepted
It is possible that an object that was not "properly" saved to cause this behaviour.

One way to do that is:

Insert an object in a child context

obtain a permanent ID for that object

save to the parent context

obtain the object in the parent context

refresh the object in the parent context

access the object in the parent context (fulfil a fault for that object)

Edit:

Another way to reach this state in a single context architecture is:

Insert an object
obtain a permanent id for the object
refresh the object
try and access the object (trigger a fault on the object)

the refresh might be a result of a fetched results controller paging through the data and not necessarily something "visible" in your application.

In addition, there is a CoreData "bug" that not always allows you to catch this exception in a parent-child context architecture, but you can try ...

However, if this is the scenario you encounter, this is not a desired behaviour for your application. you are loosing the new data added to the store.

http://stackoverflow.com/questions/19994482/core-data-could-not-fulfill-a-fault-for-objects-that-were-not
4000
-deleted
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: