I am checking if an object I am getting back from the NSURLConnectionDataDelegate is the same object that I originally created. What I have been doing is:
// TESTING TO SEE IF THE RETURNED OBJECT IS THE SAME ONE I CREATED
if(connection == [self connectionPartial]) {
But was just curious is this is the same as doing:
if([connection isEqual:[self connectionPartial]]) {
It’s not the same.
This compares the address of the objects, eg. if the pointers point to the same instance.
This compares the contents of the objects. For instance for two separate
NSStringinstances, this will returnYESas long as the string content is the same: