Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8139769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:56:18+00:00 2026-06-06T11:56:18+00:00

I am not sure if what I am going to ask is actually an

  • 0

I am not sure if what I am going to ask is actually an NSDictionary with multiple keys but ok.

What I want to do is create an NSDictionary with keys and values for my data and then convert it to JSON format. The JSON format would look exactly 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 ve only used NSDictionaries like this :

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 is not all about key – value.
So my question is how would the NSDictionary be , to fit the JSON format??
Thanks for reading my post , and sorry if any confusion.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T11:56:19+00:00Added an answer on June 6, 2026 at 11:56 am

    You can have a NSDictionary inside another NSDictonary:

    NSDictionary *eventLocation = [NSDictionary dictionaryWithObjectsAndKeys:@"43.93838383",@"latitude",@"-3.46",@"latitude", nil];
    
    NSMutableDictionary *eventData = [NSDictionary dictionaryWithObjectsAndKeys:eventLocation,@"eventLocation", nil];
    [eventData setObject:@"Jun 13, 2012 12:00:00 AM" forKey:@"eventDate"];
    [eventData setObject:@"hjhj" forKey:@"text"];
    .
    .
    .
    NSMutableDictionary *finalDictionary = [NSMutableDictionary dictionaryWithObjectsAndKeys:eventData,@"eventData", nil];
    [finalDictionary setObject:@"ELDIARIOMONTANES" forKey:@"type"];
    [finalDictionary setObject:@"accIDENTE" forKey:@"title"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Not sure what's going on here, but my iPhone apps nav bar shows back
I'm not sure what's going on, but on my own laptop, everything works okay.
I'm not sure what's going on here but here's a section I'm having problems
I'm not too sure what's going on here but I'm trying to echo a
I'm not quite sure what's going on, but several issues are occurring on our
Not sure if this is the right spot to ask but I'm having a
I'm not sure if this is going too far into sys admin territory, but
So not sure if this would be the correct place to ask these but
Assume Hibernate for the ORM. I'm not sure how to ask this. I want
I'm not sure if im going about this the right way at all but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.