As the official documentation states:
There are three kinds of retainable object pointer types:
- block pointers (formed by applying the caret (^) declarator sigil to a function type)
- Objective-C object pointers (id, Class, NSFoo*, etc.)
- typedefs marked with attribute((NSObject))
When we are dealing with the Objective-C object pointers (patterns of bits indicating the location of a pointed-to object) and the code is like this:
UIColor *color1 = [UIColor whiteColor];
// Increase reference count of color1 by 1, without copying it.
UIColor *color2 = color1;
during an assignment the objects are not being copied, but their references are (with increasing reference count).
Regarding your case, as was stated in the other comment, it depends on the property attributes: the copy
attribute creates a brand new instance of the object and increments its reference count, leaving the original object unaffected.
By the way, you can verify reference count of your objects using the Allocations Instrument. Check out, for example, this nice answer to know how you can manage it.