Created
August 31, 2012 04:29
-
-
Save dkasper/3549078 to your computer and use it in GitHub Desktop.
Remove NSNull objects from NSDictionary
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 "NSDictionary+CleanNSNull.h" | |
@implementation NSDictionary (CleanNSNull) | |
-(NSDictionary *)cleanNull { | |
return [self dictionaryWithValuesForKeys:[[self keysOfEntriesPassingTest:^BOOL(id key, id obj, BOOL *stop) { | |
return ![obj isEqual:[NSNull null]]; | |
}] allObjects]]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment