Basic Information Relative error (not lazy loading). Relationships disappear

I have a basic database on which (at the moment) there are 2 Product and CompetetingProduct objects, the CompetetingProduct relationship is set to many with the products.

I create 2 mock Products and 2 mock competing products and establish a connection between them .. everything works with files .. Saved to the database, also NSlog, “po” them .. everything is fine.

Now ... when I restart the application or I request all objects of a competing product type from another view . I get a Communication Error > for communication between a competing product and products (although I added them earlier and saved)

I know about lazy loading the data core, but it isn’t here because when I try [NSSet allObjects] (also po, nslog - nothing), it returns 0 objects that objects should usually receive.

Note. Immediately after calling saveChanges - everything works

Absolutely ANY help will be greatly appreciated and win my respect and, of course, a couple of beers

Thank!

+3
source share
1 answer

If I understand the description of the problem correctly, this can be caused by the lack of a mutually oriented relationship from a competing product to the product.

If the ratio:

Product-->CompetingProduct

... and not:

Product<-->CompetingProduct

... , , , .

, , , , .

+3

Source: https://habr.com/ru/post/1769995/


All Articles