jeudi 8 janvier 2015

Why passing a weak reference to a block prevents an object from being retained?


Vote count:

0




We all know that blocks retain objects they capture. We also know we can avoid this by passing a weak reference to an object into a block. But why it works this way? To retain an object means to increase its retain count by one. Why it makes difference to pass a weak reference? Being weak or strong it will still point to the same object, and this object's retain count will be increased by block. Am I right? So why object's retain count doesn't get increased if we pass a weak reference to an object inside a block? How does it work inside?



asked 1 min ago







Why passing a weak reference to a block prevents an object from being retained?

Aucun commentaire:

Enregistrer un commentaire