How Do I Declare A Block in Objective-C? 在 Xcode 中敲 inlineBlock就可以快捷创建代码块 As a local variable: 1 returnType (^blockName)(parameterTypes) = ^returnType(parameters) {...}; As a property: 1 @property (nonatomic, copy, nullability) returnType (^blockName)(parameterTypes); As a method parameter: 1 - (void)someMethodThatTakesABlock:(returnType (^nullability)(parameterTypes))blockName; As an argument to a method call: 1 [someObject