Created
September 21, 2016 10:59
-
-
Save anonymous/c633b6e9e9cb28256b85d78ca98c89aa to your computer and use it in GitHub Desktop.
NSMutableDictionary+Nil
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
#import <Foundation/Foundation.h> | |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
NSString * const mama = @"mama"; | |
id value = nil; | |
NSMutableDictionary *dictionary = [NSMutableDictionary new]; | |
[dictionary setValue:value forKey:mama]; | |
dictionary[mama] = nil; | |
// fails | |
[dictionary setObject:value forKey:mama]; | |
NSLog(@"%@", dictionary); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment