//-------无参数传递的block-------
- (void)testBlock:(void(^)(void))nameBlock{
}
//调用
[self testBlock:^{
}];
//-------有参数传递的block-------
- (void)testBlock:(void(^)(NSString *stringName))nameBlock{
if (nameBlock) {
nameBlock(@"我草真可以啊");
}
}
//调用
[self testBlock:^(NSString *stringName) {
NSLog(@"%@",stringName);
}];