我们有
typedef id(^func)(id);
func read_file = ^(NSString *path_to_file) {
return [NSString stringWithContentsOfFile:path_to_file encoding:NSUTF8StringEncoding error:NULL];
};
Run Code Online (Sandbox Code Playgroud)
我想知道如果我在一些函数调用中将它作为参数传递,我们怎么能得到这个块的名字?例如,
fileOperator(read_file); // I want to print the block's name in this function.
Run Code Online (Sandbox Code Playgroud)
谢谢.