Created
September 21, 2014 08:42
-
-
Save quellish/85a8080db0770b3cde40 to your computer and use it in GitHub Desktop.
Parsing JSON correctly
This file contains hidden or 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
| 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