Skip to content

Instantly share code, notes, and snippets.

@elpsk
Created December 5, 2013 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elpsk/7803118 to your computer and use it in GitHub Desktop.
Save elpsk/7803118 to your computer and use it in GitHub Desktop.
- (NSDictionary*) loadJson
{
NSString *fPath = [[NSBundle mainBundle] pathForResource:@"jtest" ofType:@"json"];
NSData *data = [NSData dataWithContentsOfFile:fPath];
return
[ NSJSONSerialization JSONObjectWithData: data
options: NSJSONReadingMutableContainers
error: nil ];
}
- (NSDictionary*) parseJsonFromUrl:(NSURL*)url
{
return
[ NSJSONSerialization JSONObjectWithData:
[NSData dataWithContentsOfURL: url
] options:0 error:nil ];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment