iOS CoreData 与自身的逆关系 [英] iOS CoreData inverse relationships to itself

查看:23
本文介绍了iOS CoreData 与自身的逆关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个类似于 Twitter 用户的 CoreData 模型,当用户可以有许多其他用户关注他以及许多其他用户关注他时.我附上了我尝试使用的模型,但似乎检索关注者变得越来越复杂.处理这种情况的最佳方法是什么?

I am trying to build a CoreData model similar to Twitter user when User can have many other users who follows him and many other users followed by him. I attached the model that I have tried to use but seems it is getting to complicating to retrieve followers. What is the best way to deal with this situation?

推荐答案

我认为您需要创建第二个关系 (followedBy) 并使其相反.

I think you need to create a second relationship (followedBy) and make that the inverse.

这篇关于iOS CoreData 与自身的逆关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆