Skip to content

Instantly share code, notes, and snippets.

@dkasper
Created August 31, 2012 04:29
Show Gist options
  • Save dkasper/3549078 to your computer and use it in GitHub Desktop.
Save dkasper/3549078 to your computer and use it in GitHub Desktop.
Remove NSNull objects from NSDictionary
#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