Last active
August 29, 2015 14:06
-
-
Save remirobert/e45a64ebfb8a0a75f5bb to your computer and use it in GitHub Desktop.
Json DATA
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
NSDictionary *jsonDictionary = @{@"username":@"[email protected]", @"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