Skip to content

Block 和 函数指针的区别? #37

Open
@tbfungeek

Description

这个问题个人理解是:Block是一个对象,它有两个关键的部分一个是Funcptr用于表示block可执行的部分,另一个是Block捕获的变量(包括局部变量,局部静态变量,__block 变量),当然还有block描述部分。也就是说它是由数据和函数指针构成的,而函数指针的地位其实就相当于Block中的Funcptr。可以将Block理解为它就是将函数和数据打包在一起可以随时运行的一个对象。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions