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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T01:14:29+00:00 2026-06-07T01:14:29+00:00

I am trying to build my first iOS app that parses json from a

  • 0

I am trying to build my first iOS app that parses json from a web service.

In my .h file i create an array

NSArray *items;

In my .m file i call the website and store the data into the array. This all goes fine except eventually I am trying to display the data in a uitableview.

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"ItemsCell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    NSLog(@"%@",items);

    NSDictionary *item = [items objectAtIndex:indexPath.row];
    NSString *title = [item objectForKey:@"title"];

    cell.title.text = title;

    return cell;
}

The nslog of items produces:

{
category = code;
keyword = "";
limit = 20;
lowPrice = "";
page = 0;
products =     (
    {
        description = "...";
        mobileFriendly = 1;
        popularity = 2021;
        productId = code;
        title = "title";
    }, and so on...
)

I am getting an error trying to do NSDictionary *item = [items objectAtIndex:indexPath.row]; It says doing objectAtIndex:indexPath.row is invalid.

What am I doing wrong?

Thanks for your help!

  • 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-07T01:14:30+00:00Added an answer on June 7, 2026 at 1:14 am

    The value stored in items is an instance of NSDictionary, but you’re sending it an NSArray message. Also, the code you posted is referring to gift and ignoring the item anyway.

    The array you’re looking for is actually stored under the key products inside the items dictionary, so you need to do something like this:

    NSArray *products = [items objectForKey:@"products"];
    
    NSDictionary *product = [products objectAtIndex:indexPath.row];
    // Then use the product, instead of using 'gift' (whatever that is).
    NSString *title = [product objectForKey:@"title"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am (trying) to build a web app, first one :) I need to
I'm trying to build my first facebook app, and it seems that the python
I'm trying to build an app that features a button on the first view,
I am trying to Build a simple search that first grabbs 'query' from a
I'm trying to build my first GAE app with jinja2. After overcoming a dozen
I'm trying to build my first GAE app with jinja2. After overcoming a dozen
I've been trying to build my first rails app and have gotten stuck on
I have just started trying to build my first wp7 app, and I am
I'm trying to build my first app on CodeIgniter. This is also my first
I'm trying to build my first app on CodeIgniter. This is also my first

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.