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

  • Home
  • SEARCH
  • 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 9298569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T22:21:25+00:00 2026-06-18T22:21:25+00:00

Ok I get and store a Json feed to an array called jsonArray. I

  • 0

Ok I get and store a Json feed to an array called jsonArray. I then loop over the jsonArray pulling out the array keys and storing them as strings. I then add those strings to an inner dictionary called innerDict, I then add that dictionary to the info dictionary with the key thePostCode using the below. So basically innerDict is stored inside infoDict.

-(void)pointInfo{

infoDict = [[NSMutableDictionary alloc]init];

for (int i = 0; i < jsonArray.count; i++) {

innerDict = [[NSMutableDictionary alloc]init];

info = [[jsonArray objectAtIndex:i]objectForKey:@"inf"];
thePostCode = [[jsonArray objectAtIndex:i]objectForKey:@"pc"];
mail = [[jsonArray objectAtIndex:i]objectForKey:@"mail"];
url = [[jsonArray objectAtIndex:i]objectForKey:@"url"];
type = [[jsonArray objectAtIndex:i]objectForKey:@"items"];

[innerDict setObject:type forKey:@"Items"];
[innerDict setObject:info forKey:@"Info"];
[innerDict setObject:mail forKey:@"Mail"];
[innerDict setObject:url forKey:@"Url"];

[infoDict setObject:innerDict forKey:thePostCode];

}

the output of infoDict looks like this:

infoDict is {
"ME14 4NN" =     {
    Info = "";
    Items = 4;
    Mail = "";
    Url = "";
};
"ME15 6LG" =     {
    Info = af;
    Items = "0,6,9";
    Mail = "";
    Url = "";
};
"ME15 6YE" =     {
    Info = "";
    Items = "4,5,6,7,11";
    Mail = "";
    Url = "";
};
}

Now what I want to do is get the values of the innerDict object i.e “ME15 6YE” above and use that as the query to pull out the associated data for Info, Items, Mail and Url keys. I have been staring at my screen for a few hours but I am just not getting it.

I can pull out the last object of the inner dict using the below however I would like to grab all the values associated with a particular postcode which would be the innerDict key. Completely brain fried at the moment!

for (NSMutableDictionary *dictionary in infoDict) {

    NSLog(@"URL %@", [innerDict objectForKey:@"Url"]);
    NSLog(@"MAIL %@", [innerDict objectForKey:@"Mail"]);
    NSLog(@"ITEMS %@", [innerDict objectForKey:@"Items"]);
    NSLog(@"ITEMS %@", [innerDict objectForKey:@"Info"]);

}
  • 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-18T22:21:26+00:00Added an answer on June 18, 2026 at 10:21 pm

    To get the correct inner dictionary, use objectForKey:

    NSDictionary *innerDict = [infoDict objectForKey:@"ME15 6YE"];
    NSLog(@"Url %@", [innerDict objectForKey:@"Url"]);
    NSLog(@"Mail %@", [innerDict objectForKey:@"Mail"]);
    NSLog(@"Items %@", [innerDict objectForKey:@"Items"]);
    NSLog(@"Info %@", [innerDict objectForKey:@"Info"]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to get the keys and values and store them in separate
I just want to quickly store an array which I get from a remote
Possible Duplicate: Convert Javascript Array to JSON I am trying to figure out how
Possible Duplicate: Storing Objects in HTML5 localStorage I'm trying to store JSON data, name
I am currently trying to store JSON stringified objects into an array so I
my mvc applications works fine. However when i run the sdk. I get store
I have huge amount of data from database, i need to get or store
I'm currently learning clojure, but I was wondering how to get and store user
I'm trying to get the lower store from a 2010 Exchange server, and the
I get data from server: store = new dojox.data.QueryReadStore({url:http://url_with_data}); ... myGrid = new dojox.grid.DataGrid({id:myGrid2,selectionMode:none,style:height:

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.