Skip to content

Instantly share code, notes, and snippets.

@quellish
Created September 21, 2014 08:42
Show Gist options
  • Select an option

  • Save quellish/85a8080db0770b3cde40 to your computer and use it in GitHub Desktop.

Select an option

Save quellish/85a8080db0770b3cde40 to your computer and use it in GitHub Desktop.
Parsing JSON correctly
NSError *error = nil;
id jsonObject = nil;
jsonObject = [NSJSONSerialization JSONObjectWithData:data options:options:NSJSONReadingAllowFragments error:&error];
if (jsonObject != nil){
[self dostuffWith:jsonObject];
} else {
[self presentError:error];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment