How to properly trim object graph brought in by NSFetchedResultsController?

旧街凉风 提交于 2019-12-02 04:58:11
Dan Shelly

As I mentioned in my comments HERE, the FRC is responsible to fault-in or fault-out the objects it fetched.
Which in turn break any strong reference cycles between your managed objects.

You can test this by setting a breakpoint in your objects willTurnIntoFault method when scrolling a large enough table.

This is done with no regards as to what other objects reference these fetched objects (as far as I can tell).

I think you should simply avoid strong reference cycles. Usually, there is no compelling reason to have to deal with the problem you describe.

For a detailed discussion, see Apple's Encapsulating Data chapter of the Programming with Objective-C guide where you will find a section titled Avoid Strong Reference Cycles.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!