By default, blocks are global in status. They turn into stackblocks when a local variable (outside the block literal) or an ivar gets captured. So if we were to NSLog(@"%@", self.block) before the assignment- "self.block= block" happens , we'd get something like . After the assignment- "self.block= block" runs, the the global-block gets copied into the heap section of the address-space of the currently running program. And so after this, were we to NSLog(@"%@", self.block), we'd get something like .
Yup, in Swift they're called Closures and in C++ (and Java too if I'm not mistaken) it's called a Lambda (which to me is the best name). Very useful stuff indeed.
Is the first carat supposed to be outside the parentheses in the code example? It's inconsistent with the explanation above it.... (01:46)
By default, blocks are global in status. They turn into stackblocks when a local variable (outside the block literal) or an ivar gets captured. So if we were to NSLog(@"%@", self.block) before the assignment- "self.block= block" happens , we'd get something like . After the assignment- "self.block= block" runs, the the global-block gets copied into the heap section of the address-space of the currently running program. And so after this, were we to NSLog(@"%@", self.block), we'd get something like .
All videos so far in this tutorial nice, thanks.
Any good book or video tutorial recommendations for building Cocoa apps for macOS?
What if you don't want a specific time delay and instead you want the next set of code to execute AFTER a certain set of code has executed??
why we need to use blocks. what is the exact reason for introduction for blocks?
this is the best instrument for async operation
Yup, in Swift they're called Closures and in C++ (and Java too if I'm not mistaken) it's called a Lambda (which to me is the best name). Very useful stuff indeed.
Wonderful
add subtitles