3 ms·
That's because blocks aren't completely objective-c objects. They can act like them in some cases, but underneath they are still C based. That's why you pass NU
by paintstripper 13y ago
That's because blocks aren't completely objective-c objects. They can act like them in some cases, but underneath they are still C based. That's why you pass NULL instead of nil to specify an empty block.
- mikeash 13y agoAll of Objective-C is C based in the end. Blocks are completely Objective-C objects. Attempting to call a NULL block crashes not because blocks aren't Objective-C objects, but because block invocation is not a message send. Note that accessing an instance variable of a nil Objective-C object pointer will also crash, e.g.: obj->_ivar; That's obviously not because Objective-C objects aren't Objective-C objects. The crash when calling a nil block is the same thing.