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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:22:15+00:00 2026-06-03T04:22:15+00:00

I need some help with an array that I am working on. I am

  • 0

I need some help with an array that I am working on.

I am pulling back some data from a JSON query and writing it into an array, and then in a second loop I am writing that array into another array but I don’t know how to read the data back out??
This is the code:-

for (NSDictionary *weather in weatherarray)
{
    int j = 1;
    NSArray *hourlyArray = [weather objectForKey:@"hourly"];
    for (NSDictionary *hourD in hourlyArray)
    {

        [multi addObject:Date];
        [multi addObject:[hourD objectForKey:@"time"]];
        [multi addObject:[hourD objectForKey:@"weatherCode"]];            
        [multi addObject:[hourD objectForKey:@"tempC"]]; 
        [multi addObject:[hourD objectForKey:@"FeelsLikeC"]];            
        [multi addObject:[hourD objectForKey:@"chanceofrain"]];            
        [multi addObject:[hourD objectForKey:@"cloudcover"]]; 
        [multi addObject:[hourD objectForKey:@"WindGustMiles"]]; 
        [multi addObject:[hourD objectForKey:@"humidity"]];             
        [multi addObject:[hourD objectForKey:@"pressure"]]; 
        j = j + 1;
    }     

    [[multi1 objectAtIndex:j] addObject:multi]; 
    i = i + 1;
} 
NSLog(@"%@", [[[multi1 objectAtIndex:1] objectAtIndex:0] objectAtIndex:1]);

}

as you can see I am trying to read the data out at the end in an NSLog but i am struggling, with this. Can anyone help please??

  • 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-03T04:22:16+00:00Added an answer on June 3, 2026 at 4:22 am

    You need to define and assign multi within the for loop. So, put the line

    NSMutableArray *multi = nil;
    

    above the line [multi addObject:Date] and move your line

    [[multi1 objectAtIndex:j] addObject:multi];
    

    above the line j = j + 1;. You don’t need the i = i + 1; here, unless you are doing something with it, that is outside the scope of this code fragment.

    Unless I have missed something, it should work like that.

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

Sidebar

Related Questions

I am working with an array and need some help. I would like to
I need some help with a program that I am writing for my Systems
I need some help with an array and a foreach loop, I have an
I need some help setting up a PHP array. I get a little lost
I need some help with a program I'm writing for my Programming II class
I need some help in converting my script from using mysql to mysqli I
I'm new to working with arrays so I need some help. With getting just
I need some help with re-working the logic on this php code. What I'd
I'm working on a Coldfusion project where I need to pull some information from
I'm working on a web application that takes its data from a web page

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.