Skip to content

Instantly share code, notes, and snippets.

@alex-zige
Created February 12, 2014 01:19
Show Gist options
  • Save alex-zige/8948097 to your computer and use it in GitHub Desktop.
Save alex-zige/8948097 to your computer and use it in GitHub Desktop.
iOS read local JSON for object parsing
NSString *jsonFileName =@"your-json-file-name";
NSString *filePath = [[NSBundle mainBundle] pathForResource:jsonFileName ofType:@"json"];
NSData *JSONData = [NSData dataWithContentsOfFile:filePath options:NSDataReadingMappedIfSafe error:nil];
NSDictionary *jsonObject = [NSJSONSerialization JSONObjectWithData:JSONData options:NSJSONReadingMutableContainers error:nil];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment