I’m trying to compare two files by fileId. fileId is an NSNumber.
I was surprised that while file and lFile had the same location in memory, the if statement did not return true, and did the method did not return true until my comparison using isEqualToNumber was true.
Why would two items with the same memory address not return true using == for the comparison?

Look carefully. Note that you aren’t comparing the addresses of
fileandlfile, you’re comparing the values returned by their respectivefileIdproperties.If the
fileIdproperty returns a copy of the underlyingNSNumberobject, then the two values returned will not compare equal with the equality (==) operator, because they are two distinct objects. They are, however, going to be considered equal by theisEqualToNumber:method.