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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:20:44+00:00 2026-05-25T10:20:44+00:00

I have following structure: Get Handbook: //request { type: handbook, hash: } //response {

  • 0

I have following structure:

Get Handbook:

//request

{
   "type": "handbook",
   "hash": ""
}

//response

{
    "body": {
        "songs": [
            {
                "id": 1,
                "length": 1231,
                "name": "song 1"
            },
            {
                "id": 2,
                "length": 3155,
                "name": "song 2"
            }
        ],
        "setlists": [
            {
                "id": 1,
                "name": "setlist1",
                "songs": [
                    {
                        "id": 1
                    },
                    {
                        "id": 2
                    }
                ]
            },
            {
                "id": 2,
                "name": "set list 2",
                "songs": [
                    {
                        "id": 3
                    },
                    {
                        "id": 4
                    },
                    {
                        "id": 5
                    }
                ]
            }
        ]
    },
    "state": true,
    "type": "handbook"

}

I need an advice for solving two problems:
1) How can i map objects in the “body” of response?
2) How can i connect Setlist to it’s Songs?

  • 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-25T10:20:45+00:00Added an answer on May 25, 2026 at 10:20 am

    Use a JSON parser such as SBJSON to parse the response into a hierarchy of NSDictionary and NSArray objects. To “connect” the songs listed in a set list to the songs themselves, you will have to do some manual manipulation of those parsed objects. You have a few options for this:

    • You could add a reference to the song object within the songs array as another value within each set list dictionary. This can work, but you will have to be careful to avoid retain cycles, where a dictionary retains a reference to a an object that directly or indirectly retains a reference to the dictionary itself. I don’t think this would necessarily a problem for your data, but it’s a nasty thing to deal with if the structure evolves and gets more complicated.

    • You could define object classes of your own rather than using NSArray and NSDictionary directly. Could have similar retain cycle complexities, but a little more manageable than doing it with the collection classes.

    • Copy the data from these objects into NSManagedObject instances with appropriate CoreData modeling. This is the most elegant and robust solution, but may be overkill for your requirements

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

Sidebar

Related Questions

I have this following structure: public class Dummy { public string Name { get;
I have the following structure: -uploadpage.html -index.php -resources -jquery-1.4.2.min.js On my index.php, I get
I have the following structure: class FeatureType(models.Model): type = models.CharField(max_length=20) def __unicode__(self): return self.type
I have the following structure: MyClass { guid ID guid ParentID string Name }
I have the following structure in XAML: <Grid> <ItemsControl x:Name=Items ItemsSource={Binding Path=Pages} Grid.Row=0 Grid.Column=0>
I have the following structure: struct hashItem { char userid[8]; char name[30]; struct hashItem
I have the following structure: abstract class Base { public abstract List<...> Get(); //What
I have following table structure in my DB ID Name -------------------------- ID_1 Name1 ID1
I have the following structure: T1{id,person1,person2} T2{id,name} T1.person1 and T1.person2 are ids from T2.id
I have following structure: class Employee { public long Id { get; set; }

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.