I have an entity Order which has to-many relationship with OrderItem entity.
In case if I want to delete one from Order. What is the best way for that? Assumnig that one OrderItem is suitable only for one Order:
-
[order deleteOrderItem:orderItem];
-
[managedObjectContext deleteObject:orderItem];
Thanks!
It shouldn’t matter, so long as Order’s “orderItems” relationship has an inverse relationship that points back to Order.