我Order<-->>Row
与两个关系删除规则都设置为Nullify
. 但是当我如下删除一行时,它不会从订单的行列表中删除吗?
// Prints "1" as there is one row in the order
NSLog(@"Number of children before: %d", order.rows.count);
for (Row *row in order.rows)
[moc deleteObject:row];
// Prints "1", should be "0"
NSLog(@"Number of children after: %d", order.rows.count);
这可以强制行为,但它不应该是必需的。可能有什么问题?
for (Row *row in order.rows)
{
[moc deleteObject:row];
[order removeRowsObject:row];
}