Let’s suppose I have an instance anInstance of some class that has a property aProperty. When I use anInstance.aProperty inside a block, does the block capture the (pointer) value of anInstance and then send the aProperty message to that captured (pointer) value or does the block only capture the value of anInstance.aProperty?
Let’s suppose I have an instance anInstance of some class that has a property
Share
The block will capture
anInstancehere. Remember that property accesses are just message sends.If you think about it as
[anInstance aProperty]it may be more obvious. But to note,anInstance->someIvarstill capturesanInstanceand not the iVar.