你的位置:首页 > 软件开发 > 操作系统 > (译文)IOS block编程指南 4 声明和创建blocks

(译文)IOS block编程指南 4 声明和创建blocks

发布时间:2015-09-09 12:00:04
Declaring and Creating Blocks (声明和创建blocks)Declaring a Block Reference (声明一个block引用)Block variables hold references to blocks. You declare t ...

 

Declaring and Creating Blocks (声明和创建blocks)

Declaring a Block Reference (声明一个block引用)

Block variables hold references to blocks. You declare them using syntax similar to that you use to declare a pointer to a function, except that you use ^ instead of *. The block type fully interoperates with the rest of the C type system. The following are all valid block variable declarations:

block变量维持了一个对block的引用。你声明block使用了和声明函数指针相同的语法,除了你使用“^”代替了“*”之外。block类型可以和全部C类型系统相互操作。下列都是block变量的声明:

void (^blockReturningVoidWithVoidArgument)(void);int (^blockReturningIntWithIntAndCharArguments)(int, char);void (^arrayOfTenBlocksReturningVoidWithIntArgument[10])(int);

本文原创,转载请注明出处:http://blog.csdn.net/zhenggaoxing/article/details/44308855


原标题:(译文)IOS block编程指南 4 声明和创建blocks

关键词:IOS

IOS
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。