我有一个关系Order<-->>Row
,关系删除规则都设置为Nullify
。但是当我删除如下所示的行时,它不会从Order的行列表中删除吗?
// 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];
}