Obj-C 块是我最近第一次使用的东西。我试图理解以下块语法:
在头文件中:
@property (nonatomic, copy) void (^completionBlock)(id obj, NSError *err);
在主文件中:
-(void)something{
id rootObject = nil;
// do something so rootObject is hopefully not nil
if([self completionBlock])
[self completionBlock](rootObject, nil); // What is this syntax referred to as?
}
我感谢您的帮助!