局部變量:
atom
returnType (^blockName)(parameterTypes) = ^returnType(parameters) {...};
屬性:code
@property (nonatomic, copy) returnType (^blockName)(parameterTypes);
消息參數:class
- (void)someMethodThatTakesABlock:(returnType (^)(parameterTypes))blockName;
消息調用時的參數:變量
[someObject someMethodThatTakesABlock:^returnType (parameters) {...}];
類型定義:copy
typedef returnType (^TypeName)(parameterTypes); TypeName blockName = ^returnType(parameters) {...};