As for the code below, once the block has been placed in an array, how can you take this block object and run the actual code in the block.
Another question: if I call a method in a block, as shown below, will this block encapsulate the code in this method or capture the signature of the method and call it this way?
-(void)blockCalledMethod { NSLog(@"Hello World"); } -(void)programStart { NSArray * array = [[NSArray alloc] initWithObjects:[[^ { [self blockCalledMethod];} copy] autorelease],nil]; id pointerToBlock = [array lastObject]; }
source share