0
我有一個託管對象與其他子託管對象處於「多對多」關係。當我刪除一個子管理對象時,表示與子管理對象的關係的主管理對象上的數組將被清空。核心數據,刪除託管對象對對象「superView」的影響
下面是當我獲取一個子管理對象並將其刪除時發生的情況的日誌。我本來期望的操作的結果是,該.subMO陣列的數量爲1
NSLog(@"%d", superViewMO.subMO.count); //this gives 2
NSLog(@"%d", fetchedSubMOArray.count); //this gives 1
[managedObjectContext deleteObject:[fetchedSubMOArray objectAtIndex:0]];
NSLog(@"%d", superViewMO.subMO.count); //this gives 0