我有一个核心数据类Game,它与另一个类Player有很多关系 . 这就是他们的 Headers
@property (nonatomic, retain) NSSet * players; // In Game.h
@property (nonatomic, retain) Game * game; // In Player.h (the inverse relationship)
当我向Game类发布最后一个外部引用时,不会调用didTurnIntoFault . 现在,我的问题是,这可能是由于上面创建的循环引用(正如您所看到的,两个属性都是'保留'),或者核心数据是否管理了所有这些并且问题出现在我的代码中 .
1 回答
见Core Data Programming Guide: Memory Management (Breaking Relationship Retain Cycles) .