Do auto generated core data accessors automatically delete objects?
Say you've got entity A, and it has a to-many relationship with entity B. If i use the auto-generated 开发者_Python百科accessor [entityA removeEntityBObject:entityB];
, is entityB deleted or simply removed from entityA?
If it doesn't auto delete, is there a way to make it do so?
In your core data model, there's a field call "Delete Rule" for relationship.
You can choose Cascade, Nullify, Deny and No Action. Check the documentation for detail of what each of them do.
精彩评论