Created
August 1, 2012 19:40
-
-
Save ccarse/3230017 to your computer and use it in GitHub Desktop.
Obj-C new literal types example.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Before | |
NSMutableDictionary *mainDict = [[NSMutableDictionary alloc] init]; | |
[mainDict setObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[NSNumber numberWithBool:false], serverBlob, nil] | |
forKeys:[NSArray arrayWithObjects:@"moreChangesAvailable", @"serverBlob", nil]], changes, nil] | |
forKeys:[NSArray arrayWithObjects:@"__sync", @"results", nil]] | |
forKey:@"d"]; | |
// After | |
NSDictionary *mainDict = @{@"d":@{@"__sync":@{@"moreChangesAvailable":@0, @"serverBlob":serverBlob}, @"results":changes}}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment