What the block needs to know.

Source: Internet
Author: User
/* what the block wants to master 1> How to define the block variable int (^sumblock) (int, int); void (^myblock) ();  2> How to use block encapsulation code ^ (int a, int b) {return a-a    ;};  ^ () {    NSLog (@ "----------");};  ^ {    NSLog (@ "----------");};  3> block Access outside variable * block inside can access the outside of the variable * By default, the inside block cannot modify the outside local variable * to the local variable plus the __block keyword, this local variable can be modified within the block  4> Use typedef to define the block type typedef int (^myblock) (int, int); You can then use this type of Myblock to define the block variable Myblock block; Myblock B1, B2;  B1 = ^ (int A, int.) {return a-B    ;};  Myblock B3 = ^ (int a, int b) {    * /

What the block needs to know.

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.