Is there an easy/generic way to compare two objects to see if they are the same? By ‘same’ I mean identical entity name, all attributes and relationships are the same, but the internal object ID is different.
Similarly, is there an easy/generic way to find the differences?
Do you need to recursively include equality of relationships (i.e. relationships point to destinations that are equal by your definition)? Do you need to test equality across managed object models? Do you need to test uncommitted values? Assuming the answer is “no” to all these, the solution isn’t too hard…
instance1is equal toinstance2by your definition if:If the answer to any of the above questions is “yes”, the solution is significantly more complex.
Caveat
I’m not sure any of this is a good idea. You probably want to rethink your design if you need to use the solution above. There are almost certainly better ways to do what you’re trying to do that don’t run the risk of running afoul of Core Data’s intentions.