xykong36 / SplitCircle

Big Money Split App
0 stars 0 forks source link

添加新的Expense报错 #44

Closed xykong36 closed 5 months ago

xykong36 commented 5 months ago
Thread 1: "Illegal attempt to establish a relationship 'payees' between objects in different contexts (source = <NSManagedObject: 0x6000022e13b0> (entity: Expense; id: 0x60000035eb80 

应该是添加MemberGroup 的Context 和 添加Expense的Context 不一致

xykong36 commented 5 months ago

insert的时候不能一个model已经在modelContext 中 另一个不在,必须同时操作 我的payee 和 payer是从已经有的memberGroup拿到的 所以不行

45