Created
May 20, 2013 04:42
-
-
Save iandundas/5610464 to your computer and use it in GitHub Desktop.
NSJSONSerialization usage
This file contains hidden or 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
NSDictionary *data = [NSDictionary dictionaryWithObjectsAndKeys:@"Object", @"Key" , nil]; | |
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:data options:0 error:nil]; // can give option NSJSONWritingPrettyPrinted | |
NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment