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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:30:45+00:00 2026-06-12T16:30:45+00:00

wanna ask about json and dictioary also array now i’ve json data like this

  • 0

wanna ask about json and dictioary also array

now i’ve json data like this

{
  data: [
          {

            featured: true,
            price: {
                        currency: "IDR",
                        amount: 5557679,
                        formatted: "Rp5.558.000"
          },
    ]
}

and this is my syntax to call this

NSArray* deals_global_json = [json objectForKey:@"data"]; //2
          if(deals_global_json!=NULL){

              for (int i=0;i<[deals_global_json count];i++){

                  NSDictionary* jsonData = [deals_global_json objectAtIndex:i];

                  NSString *featured=[jsonData objectForKey:@"featured"];
                  NSArray *price=[jsonData objectForKey:@"price"];
                  NSDictionary *formatted =[price objectAtIndex:0];


              }

and it error, how to parse price array like that?

  • 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-12T16:30:46+00:00Added an answer on June 12, 2026 at 4:30 pm

    This is wrong in your code:

    NSDictionary *formatted =[price objectAtIndex:0];

    because price is a Dictionary.

    You can use:

    NSString *currency = [price objectForKey:@"currency"];
    NSString *amount = [price objectForKey:@"amount"];
    NSString *formatted = [price objectForKey:@"formatted"];
    

    The difference between {…} and […]:

    • the first one is Object (an unordered collection of key:value pairs with the ‘:’ character separating the key and the value, comma-separated and enclosed in curly braces; the keys must be strings and should be distinct from each other);

    • the second one is Array (an ordered sequence of values, comma-separated and enclosed in square brackets; the values do not need to be of the same type).

    To understand, how it works, you can read more about JSON:

    http://en.wikipedia.org/wiki/JSON

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

Sidebar

Related Questions

I wanna ask you a question about JSON. I want to differentiate product by
hey guys i wanna ask a question about sending data to database to server
Just wanna ask about this php Basic access authentication, is there anyway to reduce
Q: I wanna to ask about report design issue. If my report data source
In order to learn more about this, I wanna ask for the best path
i wanna to ask about the different http,TCP,UDP protocoll in network programing, what is
I just wanna ask what best way to work around a Two-Dimensional Array (2
Hey guys, I have some questions would like to ask: I wanna ask how
i wanna ask you about your opinion: I work as independent software developer, and
I wanna ask you best practices about blog front page. I wanna build blog

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.