A question about _ _ block

problem description

using the constructor with block, there is a warning at compile time:

clipboard.png

:Variable "pointsRuleView" is uninitialized when captured by block

__block:

clipboard.png

what I want to ask is: what exactly is _ _ block doing here?

complete code: https://github.com/CaiWanFeng...

Jul.19,2022

you need to know the capture rules of block. The following is a brief introduction, which may not be very accurate, but it is probably good to understand it.
in the first case, when block captures pointsRuleView, the value of pointsRuleView is not defined, and block may capture nil, so the compiler will give you a warning.
in the second case, the _ _ block keyword is added in the case of arc. It can be understood simply that if pointsRuleView is promoted from a local variable to a global variable, the pointsRuleView value in block can be obtained normally.
the above is just a simplified answer. For more information, please refer to books such as ios Advanced to understand the implementation details of block.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e96e-e976.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e96e-e976.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?