I'm not sure what what I'm going to ask is actually an NSDictionary
with a few keys, but ok.
What I want to do is create an NSDictionary
with the keys and values ββfor my data, and then convert them to JSON
. The JSON
will look something like this:
{ "eventData": { "eventDate": "Jun 13, 2012 12:00:00 AM", "eventLocation": { "latitude": 43.93838383, "longitude": -3.46 }, "text": "hjhj", "imageData": "raw data", "imageFormat": "JPEG", "expirationTime": 1339538400000 }, "type": "ELDIARIOMONTANES", "title": "accIDENTE" }
I used only NSDictionaries
as follows:
NSArray *keys = [NSArray arrayWithObjects:@"eventDate", @"eventLocation", @"latitude" nil]; NSArray *objects = [NSArray arrayWithObjects:@"object1", @"object2", @"object3", nil]; dictionary = [NSDictionary dictionaryWithObjects:objects forKeys:keys];
But the above format applies not only to the key value. So my question is, how would NSDictionary
be to fit the JSON
? Thank you for reading my post, and I'm sorry if there was any confusion.
source share