Guest User

Untitled

a guest
May 20th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. NSError *jsonError;
  2.     NSLog(@"dictionary for json: %@",dict);
  3.    
  4.     NSData *jsonData = [NSJSONSerialization dataWithJSONObject: dict options: 0 error: &jsonError];
  5.     if(jsonError != nil)
  6.         NSLog(@"jsonError: %@",jsonError.localizedDescription);
  7.     else
  8.         NSLog(@"jsonError is nil");
  9.    
  10.     BOOL jsonBool = [NSJSONSerialization isValidJSONObject: jsonData];
  11.     if(jsonBool == YES)
  12.         NSLog(@"json: YES");
  13.     else
  14.         NSLog(@"json: NO");
Add Comment
Please, Sign In to add comment