Skip to content

Instantly share code, notes, and snippets.

@remirobert
Last active August 29, 2015 14:06
Show Gist options
  • Save remirobert/e45a64ebfb8a0a75f5bb to your computer and use it in GitHub Desktop.
Save remirobert/e45a64ebfb8a0a75f5bb to your computer and use it in GitHub Desktop.
Json DATA
NSDictionary *jsonDictionary = @{@"username":@"ok@free.fr", @"password":@"aaaaa"};
NSError *error;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:jsonDictionary options:0 error:&error];
if (!jsonData) {
NSLog(@"JSON ERROR");
} else {
NSString *JSONString = [[NSString alloc] initWithBytes:[jsonData bytes] length:[jsonData length] encoding:NSUTF8StringEncoding];
NSLog(@"JSON OUTPUT: %@",JSONString);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment