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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:24:32+00:00 2026-05-20T01:24:32+00:00

I have a nested NSDictionary of NSDictionaries. I get the dictionaries in an NSArray

  • 0

I have a nested NSDictionary of NSDictionaries.
I get the dictionaries in an NSArray *array and I iterate through them with for (NSDictionary *frame in array)

What I want is the name of the frame. For example [frame getName], is there any function for this?

  • 1 1 Answer
  • 1 View
  • 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-20T01:24:32+00:00Added an answer on May 20, 2026 at 1:24 am

    If your array looks like this

    <array>
        <dict>
            <key>name</key>
            <string>My First Frame</string>
            ...
        </dict>
        <dict>
            <key>name</key>
            <string>My Other Frame</string>
            ...
        </dict>
        ...
    </array>
    

    Then you would use this to get the name:

    for (NSDictionary *frame in array) {
        NSString *frameName = [frame objectForKey:@"name"];
    }
    

    However, if your dictionaries do not actually contain your frame’s name, then you’re out of luck (in an array, elements are stored using an index, not with a key).

    Now, you’ve also referred to “nested NSDictionaries of NSDictionaries” above. If you have for example the following structure, where the name is the key in the outer dictionary:

    <dict>
        <key>My First Frame</key>
        <dict>
            <key>width</key>
            <integer>300</integer>
            <key>height</key>
            <integer>200</integer>
            ...
        </dict>
        <key>My Second Frame</key>
        <dict>
            <key>width</key>
            <integer>150</integer>
            <key>height</key>
            <integer>105</integer>
            ...
        </dict>
        ...
    </dict>
    

    Then you could use this:

    for (NSString *frameName in [outerDict allKeys]) {
        NSDictionary *frame = [outerDict objectForKey:frameName];
        // now you have both the key (frameName) and the value (frame) to work with
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have nested containers std::map<int, std::map<T, U> > and want to populate them properly,
What if I have nested loops, and I want to break out of all
I have nested quotes enabled in my private message system, but now I want
We have many SVN Repo's but many of them have nested projects. I need
I have a array with nested dictionary data like this: [{ link : [
Let's say I have an NSDictionary with a nested NSDictionary like this (simplified, I
I have nested structure very similar to folder structure, like: Array ( [level_one_1] =>
I have nested iterator in my custom stack template class. The problem I get
I have a dictionary with nested dictionaries (as per flash cards) in my application.
I have nested array in javascript like this: testArray['element1'] = {par1: value1, par2: value2

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.