3

I want to create friends list in my core Data. I have entity User with relationship friends. My user have attributes (to simplify):

  • userId
  • name

I want that he can make friends so i add this relationship:

enter image description here

All friends of course will be have the same pair of attribute.

So when i look into graph i see something like this:

enter image description here

This is correct ? Can i managed it like separate entity? Will creating a new friend create a new user? What is keyword for apple documentation to find an example or description of this behavior?

4

1 回答 1

3

关系是绝对正确的,只是友谊自然是双向的,所以反向关系也是朋友。没有创建朋友这样的问题,因此它不会创建新用户。您可以在两个现有用户之间建立友谊关系。您正在寻找的关键字是:核心数据编程指南 :)

于 2013-11-03T19:50:39.347 回答