Skip to content

Instantly share code, notes, and snippets.

@aki-null aki-null/gist:2490310 forked from hajipy/gist:2490294
Created Apr 25, 2012

Embed
What would you like to do?
[NSDictionary objectForKeyWithoutNull]
@implementation NSDictionary (objectForKeyWithoutNull)
- (id)objectForKeyWithoutNull:(id)aKey
{
id value = [self objectForKey:aKey];
if (value == [NSNull null]) {
return nil;
}
else {
return value;
}
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.