开发者

Core Data: does delete an entity remove all relationships of other entities to it?

开发者 https://www.devze.com 2023-04-02 04:33 出处:网络
Say if I have two entities: MySubscription and AllSubscription, MySubscription has a one to one relationship to AllSubscription, thus AllSubscription has a inverse relationship to MySubscription, say:

Say if I have two entities: MySubscription and AllSubscription, MySubscription has a one to one relationship to AllSubscription, thus AllSubscription has a inverse relationship to MySubscription, say:

MySub     AllSubs
a   <--->   A
            B
c   <--->   C
            D
e   <--->   E

if I delete a, does Core Data automatically开发者_如何学Python set A.mysub to nil?


All depends on your choice of delete rule, which can be specified for each relationship. The rule you are describing is called "nullify".

0

精彩评论

暂无评论...
验证码 换一张
取 消