CoreData could not fulfill a fault for

后端 未结 5 816
我在风中等你
我在风中等你 2021-01-30 13:45

I have a really annoying problem, which I just can\'t seem to get fixed.

I have a view when I send a message that gets saved to the Core Data, when thats done it asked

5条回答
  •  一向
    一向 (楼主)
    2021-01-30 14:18

    This happens because you are adding the "random message" to your new row before completion of fetching all your relations of the first call.

    You can add a prefetch to your 1st call to avoid the lazy loading and the issue will be solved, I believe.

    This is how we can do prefetching for the request:

    [request setRelationshipKeyPathsForPrefetching:[NSArray arrayWithObjects:@"whatEverOfYourWillNumberOne",@"whatEverOfYourWillNumberTwo", nil]];
    

    Hope that helps.

提交回复
热议问题