Declaring propertyName
as a "weak" property means two things:
When you assign an object to
propertyName
, that object's reference count is not incremented.When the object that
propertyName
points to is deallocated,propertyName
will be set tonil
.
Assigning the value of propertyName
to another variable may or may not have any impact on the reference count. If you assign it to a strong
property, you will almost certainly increase the refcount (since that is part of the semantics of a strong
property). But ultimately the compiler will decide if modifying the reference count is necessary.
It's important to understand the concept of object ownership in Objective-C, whether you are using ARC or not, but the details of the actual reference count for a given object at any given moment are not so useful. Remember this: a strong
property owns an object. A weak
property does not.