IOS __block Variable Scope

Source: Internet
Author: User
Tags variable scope

See

In the C language, 2 Independent functions are not able to access local variables (inline?). But block provides this function, it can not only read variables, but also write to the variables! Indicates that the block obtained the last true value of I 5, not just 0, which is the function of __block. See J again, because there is no __block prefix, only achieved 0, did not get 5. The function of __block is simply to copy a copy into the heap and maintain the copy's survival, so you can use the local variables in the function that has ended.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.