How can I find value differences between two objects of same type. For-example I have a Rectangle class having x, y, width, height properties and two objects of rectangle class. How can I find(either programmatically or any visualization tool or library etc) which properties of one rectangle differ from second rectangle?
Or is there any way of getting object state on console or to a file?
The other answers are just fine if you actually know the class of your objects at compile time. If not this is the case you are still lucky because Objective C allows you to explore the instance variables of your object at runtime. A pseudo-code of comparing two unknown object could be: