0
从私有库中,我使用了这样的块函数,但不知道它们是如何实际创建的。他们将如何返回到我的班级并执行该块?Objective-c:创建块函数
ImAnotherClass *sameObj = [[ImAnotherClass alloc] init];
[sameObj testFunctionWithBlock:^(BOOL success, NSError *error)
{
if(!error)
NSLog(@"you'll only read this, once test function was done!");
}];
[sameObj release];
这里,值得注意的一点是,一个test
功能可以好好时间(以分钟为单位)来完成它的执行,但它完美地打印线块!即使我的函数已经被执行了。
这将成功阻止控制前进 – amar
我已经传递了字符串,你可以传递任何东西 – amar