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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:27:05+00:00 2026-05-25T21:27:05+00:00

I am trying to parse this from a webserver to a tableview in iOS

  • 0

I am trying to parse this from a webserver to a tableview in iOS

{
  "transactions": [
    {
    "ID": "350",
    "description": "Macbook Pro 17 inch",
    "price": "2811.83"
    },
    {
    "ID": "351",
    "description": "Macbook - white",
    "price": "1720.10"
    },
    {
    "ID": "352",
    "description": "iPad 2",
    "price": "650.00"
    },
    {
    "ID": "353",
    "description": "Macbook Pro 17 inch",
    "price": "3233.98"
    },
    {
    "ID": "354",
    "description": "Macbook Pro 15 inch",
    "price": "2100.55"
    },
    {
    "ID": "355",
    "description": "Macbook Air",
    "price": "899.99"
    },
    {
    "ID": "356",
    "description": "Mac Pro",
    "price": "3400.77"
    }
  ]
}

The only things I want from this are the descriptions and the prices. I need to add up the price of each item and get a total. Each transaction name needs to be stored in an NSArray and then displayed in a UITableView.

Any help? The JSONkit doesnt give me the SBJSON parser

  • 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-05-25T21:27:06+00:00Added an answer on May 25, 2026 at 9:27 pm

    I really liked JSONKit because of its simplicity and speed. You have to realize, what it returns is the top level construct as an object – so you have to think about it. It will be a NSDictionary (so you can typecast it), and it will have one key “transactions”.

    This key will return an NSArray of NSDictionary objects, each of which will have the keys ID, description, and price.

    So something like this (where itemListData is the JSON data fetched from the URL for example):

    JSONDecoder *decoder = [JSONDecoder decoderWithParseOptions:JKParseOptionStrict];
    NSData *immutableItemList = [itemListData copy];
    NSArray *returnedData = (NSArray *) [[decoder objectWithData:immutableItemList] objectForKey:@"transactions"];
    

    So, we took the raw JSON data, instantiated a decoder, then decoded it into a dictionary – and retrieved the 1 object in the dictionary (as an array in this case, because that’s what it is). Not too bad for a newbie, eh?

    (I should add – the reason I make an immutable copy of the NSData, is that this code snippet is in an asynchronous download, triggered in the connectionDidFinishLoading method.)

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

Sidebar

Related Questions

I'm trying to parse a html doc using some code I found from this
I am trying to parse this json data from the url but i get
I'm trying to parse an output from a server that looks like this: {
I'm trying to parse the city from this JSON file http://api.crunchbase.com/v/1/company/airbnb.js This is how
I'm trying to parse parameters from a query string using this jquery plugin and
I'm trying to parse this XML string: <?xml version=1.0 encoding=UTF-8 standalone=no?> <response type=success> <lots>
I am beginner in PHP. I am trying to parse this xml file. <relationship>
I am trying to figure out the best way to parse this comma delimited
Trying to parse some XML but apparently this is too much for a lazy
I'm trying to parse a processing instruction like this using StAX: <?item something=<some_element></some_element>?> StAX

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.