iOS Development--ui Advanced Chapter (IX) The ingenious use of block

Source: Internet
Author: User

There are mentioned in the preceding notice, agent, KVO and other methods to assist the communication between different objects, and then introduce the block to solve the problem today

Then the previous example

Here is the function to retell again

I compare the block with the notice, of course, the agent and kvo how to achieve it has been in the previous article is clear

1. First create the Block property in the cell model

2. Call Block when you click the Plus minus button

3, in the controller's Cellforrowatindexpath: method to assign a value to block

This can also be used with block and before with the notification, agent, KVO to achieve the effect of message communication

And finally put the notice here as a comparison.

iOS Development--ui Advanced Chapter (IX) The ingenious use of block

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.