Skip to content

Instantly share code, notes, and snippets.

@fjolnir
Last active August 29, 2015 14:02
Show Gist options
  • Save fjolnir/02851c79fa40db4233bb to your computer and use it in GitHub Desktop.
Save fjolnir/02851c79fa40db4233bb to your computer and use it in GitHub Desktop.
- (NSDictionary *)cy_flippedDictionary
{
NSArray * const keys = [self allKeys];
NSArray * const vals = [self objectsForKeys:keys notFoundMarker:[NSNull null]];
return [NSDictionary dictionaryWithObjects:keys forKeys:vals];
}
@B0bcat
Copy link

B0bcat commented Jun 2, 2014

NSArray *keys = [self allKeys];
NSArray *values = [self objectsForKeys:keys notFoundMarker:[NSNull null]];
NSDictionary *flipped = [NSDictionary dictionaryWithObjects:keys forKeys:values];

@fjolnir
Copy link
Author

fjolnir commented Jun 2, 2014

Nice, thanks

@B0bcat
Copy link

B0bcat commented Jun 2, 2014

no problem :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment