unsafe_unretained vs. weak
They are both representing the nonowning relationship.
But the diffrence is:
When the unsafe_unretained
object is recycled by ARC, the property is still pointing to the object. If we are calling the property, the system will crash.
However, when the weak
object is recycled by ARC, the property will be set to nil. If we are calling the property, of course nothing will happen, but the system won’t crash.
That is why weak
is safer than unsafe_unretained
.