Skip to content

Instantly share code, notes, and snippets.

@aki-null
Forked from hajipy/gist:2490294
Created April 25, 2012 14:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aki-null/2490310 to your computer and use it in GitHub Desktop.
Save aki-null/2490310 to your computer and use it in GitHub Desktop.
[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