I load json-data from my server by using FMDB. The response I get (JSON), I’m storing in a sqlite-database (same string as the response below gets stored in the database). Later on I select that data from the database through FMDB and trying to build up a NSDictionary from it, but can’t get it to work.
The json-response I get from the server looks like below (shortened down the response for this post, so it contains some more…) when I output it through NSLog:
{
response = {
data = {
"dbId_1" = {
1 = {
current = {
weekday = Tuesday;
};
};
};
};
};
}
This is how I select it from the database and what I want to make a NSDictionary from:
NSString *jsonString = [results stringForColumn:@"json"];
Is it possible to build up everything again to a NSDictionary?
Add JSONKit to your project, #import “JSONKit.h” then go:
If you’re using Automatic Reference Counting, then you’ll need to open up your Project Settings > Build Phases > Compiled Sources Panel
Look for “JSONKit.m” line and double click on it, add “-fno-objc-arc” to force no automatic reference counting for this file.
JSONKit can be downloaded here: https://github.com/johnezang/JSONKit