the first part uses the block to pass the value the thought and the step
To use the block value, you have to first figure out what time
Who is the target object of the one-pass value?
Need to get the worthy object
Who is the second-most-valued person?
The object that needs to pass the value to the target object
Communication between the three-valued person and the target object
Using block communication
The general idea is as follows:
1 Define a block of code in the header file of the person who passed the value, and make him a property of the person who passed the value
2 Implement the block code in the implementation method of the value-passing
3 Import the header file of the caller in the target object header file for the value of the pass
4 in the target object where the value is passed, call the code block
The second part of the project demonstration
In this project, Viewcontroller as the target object, Secondcontroller as the value of the transfer.
The code for Viewcontroller is as follows:
the code for Secondcontroller is as follows:
Part III
How the iOS interface passes values (a) block pass value