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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T04:34:50+00:00 2026-06-15T04:34:50+00:00

for(id key in stats) { NSLog(@key=%@ value=%@, key, [stats objectForKey:key]); } I have a

  • 0
for(id key in stats) {
    NSLog(@"key=%@ value=%@", key, [stats objectForKey:key]);
}

I have a dictionary of arrays, and each of these arrays has a number of arrays itself. Its a multidimensional array in a dictionary.

However the above code gives me the following

2012-11-30 21:36:07.203 key=main cat c value=(
"<Food: 0x6e5fb70>"
)
2012-11-30 21:36:07.205 key=main cat b value=(
"<Food: 0x6e5fa00>",
"<Food: 0x6e5faa0>"
)
2012-11-30 21:36:07.207 key=bakery_products value=(
"<Food: 0x6e5f510>",
"<Food: 0x6e5f660>",
"<Food: 0x6e5f700>",
"<Food: 0x6e5f810>",
"<Food: 0x6e5f900>",
"<Food: 0x6e5d5d0>"
)

How can I access the values in those arrays that are being displayed as Food 0x6e5fb70 ?

I’ve literally been at it for hours now and cannot find a solution.

  • 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-15T04:34:52+00:00Added an answer on June 15, 2026 at 4:34 am

    Something like this perhaps:

    for (id key in [stats allKeys]) {
        NSArray *foodArray = [stats objectForKey:key];
        for (Food *food in foodArray) {
            // do stuff with Food object
        }
    }
    

    Update (for Ploto’s 2nd comment):

    Do you mean this:

    NSArray *array = [stats objectForKey:@"bakery_products"];
    

    Update #2 for description:

    - (NSString *)description {
        return [NSString stringWithFormat:@"Food: %@, %@", whatever1, whatever2];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Each key in dictionary has list of MANY integers. I need to iterate through
MemcachedClient has a getStats method which accepts a String key for the stat value.
I have been working on an iPhone app that has a feature of uploading
I have an NSDictionary with NSStrings Some of the valueForKey:@Key have no entry so
I little confuse in NSMutableDictionary retrieving Key and Value checking for that i did
I'm thinking about trying MongoDB to use for storing our stats but have some
Goal: Combine all NSDictionaries returned with one common key value 'delay' into a single
I have a table that holds stats for a game, this table will have
Has anyone tried accessing bungie.net reach stats api (statistics from Halo Matchmaking)? As described
When key name starts with digit, in javascript we can define array-like object like

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.