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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:42:42+00:00 2026-06-14T05:42:42+00:00

So I have some XML with a structure like this: <wdata> <wid>abc123</wid> <wname>Main Name</wname>

  • 0

So I have some XML with a structure like this:

<wdata>
    <wid>abc123</wid>
    <wname>Main Name</wname>
    <wauthor>Author</wauthor>
    <plist>
        <pdata>
            <pid>def456_0</pid>
            <pname>Sub Name</pname>
            <ilist>
                <idata>
                    <iid>ghi789_0</iid>
                    <iname>iName</iname>
                    <ivalue>32</ivalue>
                </idata>
                <idata>
                    <iid>ghi789_1</iid>
                    <iname>iName</iname>
                    <ivalue>23</ivalue>
                </idata>
            </ilist>
        </pdata>
        <pdata>
            <pid>def456_1</pid>
            <pname>Sub Name</pname>
            <ilist>
                <idata>
                    <iid>ghi789_2</iid>
                    <iname>iName</iname>
                    <ivalue>24</ivalue>
                </idata>
                <idata>
                    <iid>ghi789_3</iid>
                    <iname>iName</iname>
                    <ivalue>42</ivalue>
                </idata>
            </ilist>
        </pdata>
    </plist>
</wdata>

So the <plist> can contain any number of <pdata>, and the <ilist> in each <pdata> can contain any number of <idata>.

I want to store this data in Objective C. Im guessing the best approach is for <wdata> to be an NSMutableDictionary object, with <plist> being an NSMutableArray containing an array of NSMutableDictionary objects for each <pdata>, and then each <ilist> are NSMutableArrays containing arrays of NSMutableDictionary objects for each <idata>. (!?)

My problem is Im struggling to access arrays within dictionaries, and im struggling to add dictionaries to arrays within dictionaries.

For instance I am using the following code to add a NSMutableDictionary to <plist>:

[[wdata objectForKey:@"plist"] addObject:pDictCopy];

But I get “unrecognised selector” errors on compiling.

Can anyone help me access and add data to my nested dictionaries and arrays?

Thanks in advance!

  • 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-14T05:42:43+00:00Added an answer on June 14, 2026 at 5:42 am

    Here to perform this line

    [[wdata objectForKey:@"plist"] addObject:pDictCopy];
    

    Your [wdata objectForKey:@"plist"] must return an NSMutableArray, this you can cross verify by NSLog, and check does it contains an NSMutableArray?.

    And the best approach is first create all the objects, means setting the objects for dictionaries, adding the dictionaries to array, and then set these arrays to dictionaries and later on..

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

Sidebar

Related Questions

I have some xml like this: <Data> <Rows> <Row> <Field Name=title>Mr</Field> <Field Name=surname>Doe</Field> <Row>
i have a xml with some structure like this: <data> <cond>5 &lt; 10</cond> </data>
Let's say I have xml structure like this <root> <element>some content</element> <element>some content 2</element>
I have a XML Structure that looks like this. <sales> <item name=Games sku=MIC28306200 iCat=28
I have some XML that is structured like this: <whatson> <productions> <production> <category>Film</category> </production>
I have some XML which contains records and sub records, like this: <data> <record
I have an xml structure like this <element> <foodjoint_name>DineOut</foodjoint_name> <logo>http://192.168.1.112/dineout/images/dominos.jpg</logo> </element> I am parsing
I have some XML structures like this: var struct:XML = <mh> <mi id=1 stuff=whatever/>
I have an XML structure that looks like this: <?xml version=1.0?> <survey> <responses>0</responses> <question>
I have a XML file template like this that comes from some IC chips,

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.