ViewController主要代码

Book主要代码

Book.m文件主要代码


TestViewController主要代码



Block本质是一个结构体类型的数据结构,其中里面包含一个指向代码块的函数指针,block调用的时候,底层是通过结构体里面的函数指针调用函数实现(代码块),通过__block能够修改外部变量是因为底层把外部变量的地址传到了代码块里面,所以能够修改变量值,而不加__block只是简单的把变量的值传到了代码块里面,所以不能够修改变量值.
ViewController主要代码
Book主要代码
Book.m文件主要代码
TestViewController主要代码
Block本质是一个结构体类型的数据结构,其中里面包含一个指向代码块的函数指针,block调用的时候,底层是通过结构体里面的函数指针调用函数实现(代码块),通过__block能够修改外部变量是因为底层把外部变量的地址传到了代码块里面,所以能够修改变量值,而不加__block只是简单的把变量的值传到了代码块里面,所以不能够修改变量值.
本文标题:Block高级进阶
本文链接:https://www.haomeiwen.com/subject/jyfvlctx.html
网友评论