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 6930839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:29:59+00:00 2026-05-27T11:29:59+00:00

I have my GET Method working and mapping my returned objects correctly. Now I

  • 0

I have my GET Method working and mapping my returned objects correctly. Now I am working on the POST Method. I need to serialize a Multi Level JSON, specifically it has 3 levels the in the following format

{
      "name": "Test", 
      "version": "1", 
      "iconId": 1, 
      "runFrequency": 5, 
      "lastActionSummary": "Yesterday, 9:30am", 
      "description": "Test", 
      "id": 1, 
      "containers": [
            {
                  "id": 1, 
                  "triggers": [
                        {
                              "@class": "someClass", 
                              "intValue": 90, 
                              "operator": "equal", 
                              "type": "Ttest"
                        }
                  ]
            }
      ]
}

I tried do it like I do object Mapping for responses from the server but that failed due to the fact that containers never get added to the JSON. Any ideas on how I can achieve this? The restkit examples do not show multi Level JSON so they havent helped a great deal.

  • 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-05-27T11:30:00+00:00Added an answer on May 27, 2026 at 11:30 am

    It seems like what you want here is a dictionary containing various fields:

    NSMutableDictionary *topDictionary = [[NSMutableDictionary alloc] init];
    [topDictionary setObject:@"Test" forKey:@"name"];
    [topDictionary setObject:@"1" forKey:@"version"];
    ...
    

    Then, you have an array of containers with a dictionary in each array item:

    NSMutableArray *containers = [[NSMutableArray alloc] init];
    [topDictionary setObject:containers forKey:@"containers"];
    NSMutableArray *arrayItem1 = [[NSMutableDictionary alloc] init];
    [containers addObject:arrayItem1];
    [arrayItem1 setObject:[NSNumber numberWithInteger:1] forKey:@"id"];
    ...
    

    Within each of the dictionaries under containers, you have a triggers array, again where each item of that array is a dictionary:

    NSMutableArray *triggers = [[NSMutableArray alloc] init];
    [arrayItem1 setObject:triggers forKey:@"triggers"];
    NSMutableArray *trigger1 = [[NSMutableDictionary alloc] init];
    [triggers addObject:trigger1];
    [trigger1 setObject:@"someClass" forKey:@"@class"];
    ...
    

    This just shows how to add 1 container with 1 trigger in that container, but you get the idea. Convert to the appropriate loops if you want to put more than one item in each array.

    Once you have these dictionaries (within an array, within a dictionary, within an array, within a dictionary…) you then have an object that can be serialized to JSON cleanly.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code working in C#: var request = (HttpWebRequest)WebRequest.Create(https://x.com/service); request.Method = GET;
I have created a Webpage which will post as post method..not as get method.
I have a get method passing in an object of type Store to the
I have a base class with a property which (the get method) I want
I have a written a method to get all the records and return in
I have a program that makes use of the following method to get a
I have an application (ASP.NET MVC) that uses a Next New method to get
In the following code, i have a method to get a Vector of persons
I have a requirement to get the contents of every method in a cs
I have an ASMX Web Service set up to use the HTTP GET method.

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.