From a private library, I'm using a block function like this, but don't know how actually they are created. How they will returned back to my class and execute the block ?
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];
Here, the notable thing is, a test
function can take good time (in minutes) to complete its execution, but it will perfectly print the line in block ! even my function gets executed already.