Skip to content

Instantly share code, notes, and snippets.

@MosheBerman
Last active December 17, 2015 20:29
Show Gist options
  • Save MosheBerman/5668042 to your computer and use it in GitHub Desktop.
Save MosheBerman/5668042 to your computer and use it in GitHub Desktop.
A demo of the arrayDictionaryArray category pair.
// Code:
#import "ArrayDictionaryArray.h"
- (void)sampleConversion
{
NSArray *array = @[@"Hello", @"I", @"Am", @"Deep", @"Blue"];
NSDictionary *dictionary = [array dictionary];
NSLog(@"Array: %@", [array description]);
NSLog(@"Dictionary: %@", [dictionary description]);
}
- (void) main
{
[self sampleConversion];
}
/*
OUTPUT:
2013-05-29 00:51:03.138 ArrayToDict[3835:c07] Array: (
Hello,
I,
Am,
Deep,
Blue
)
2013-05-29 00:51:03.139 ArrayToDict[3835:c07] Dictionary: {
0 = Hello;
4 = Blue;
3 = Deep;
1 = I;
2 = Am;
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment