Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSError *jsonError;
- NSLog(@"dictionary for json: %@",dict);
- NSData *jsonData = [NSJSONSerialization dataWithJSONObject: dict options: 0 error: &jsonError];
- if(jsonError != nil)
- NSLog(@"jsonError: %@",jsonError.localizedDescription);
- else
- NSLog(@"jsonError is nil");
- BOOL jsonBool = [NSJSONSerialization isValidJSONObject: jsonData];
- if(jsonBool == YES)
- NSLog(@"json: YES");
- else
- NSLog(@"json: NO");
Add Comment
Please, Sign In to add comment