Last active
August 29, 2015 14:13
-
-
Save mattjgalloway/54577d4039a81a4b4168 to your computer and use it in GitHub Desktop.
Running a block^WNSNull. Wait what?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// On iOS... | |
// This doesn't crash: | |
id null = @[[NSNull null]]; | |
dispatch_block_t block = (dispatch_block_t)null[0]; | |
block(); | |
// This does: | |
id null = [NSNull null]; | |
dispatch_block_t block = (dispatch_block_t)null; | |
block(); | |
// Points to the person who points out *why* the first doesn't crash. And more points for why the second one does. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment