Skip to content

Instantly share code, notes, and snippets.

@jdolan
Created December 13, 2014 19:51
Show Gist options
  • Save jdolan/eb3d837eaa973c7f441f to your computer and use it in GitHub Desktop.
Save jdolan/eb3d837eaa973c7f441f to your computer and use it in GitHub Desktop.
Parse a JSON file into a Dictionary and query it with JSONPath.
Data *data = $(alloc(Data), initWithContentsOfFile, path);
Dictionary *dict = $$(JSONSerialization, objectFromData, data, 0);
Number *dataStoreInitConns = $$(JSONPath, objectWithPath, dict0, "$.web-app.servlet[0].init-param.dataStoreInitConns");
assert(10 == (int) dataStoreInitConns->value);
release(data);
release(dict);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment