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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:18:51+00:00 2026-05-26T20:18:51+00:00

I’m developing an iphone app and I have a JSON from web service as

  • 0

I’m developing an iphone app and I have a JSON from web service as below:

[
    {
        "0":"test_w",
        "assignment_title":"test_w",
        "1":"2011-11-02 04:02:00",
        "assignment_publishing_datetime":"2011-11-02 04:02:00",
        "2":"2011-11-02 01:53:00",
        "assignment_due_datetime":"2011-11-02 01:53:00",
        "3":"course_math.png",
        "course_icon":"course_math.png",
        "4":null,
        "submission_id":null
    },
    {
        "0":"\u062a\u0637\u0628\u064a\u0642 \u0631\u0642\u0645 3",
        "assignment_title":"\u062a\u0637\u0628\u064a\u0642 \u0631\u0642\u0645 3",
        "1":"2011-08-08 00:00:00",
        "assignment_publishing_datetime":"2011-08-08 00:00:00",
        "2":"2011-08-25 00:00:00",
        "assignment_due_datetime":"2011-08-25 00:00:00",
        "3":"course_math.png",
        "course_icon":"course_math.png",
        "4":null,
        "submission_id":null
    }
]

also I have a tableview and I need to parser assignment_title only on the tableview cells , also I’m using SBJSON library.

so what is the best way to extract assignment_title and put them on cells?

  • 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-26T20:18:51+00:00Added an answer on May 26, 2026 at 8:18 pm

    I find the solution from your answers as below:

    I created a method with 2 parameters (json_path , field [that i need to show in tableview cell])

    - (NSMutableArray*)JSONPath:(NSString *)path JSONField:(NSString *)field{
        SBJSON *parser = [[SBJSON alloc] init];
        NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:path]];
        // Perform request and get JSON back as a NSData object
        NSData *response = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil];
    
        // Get JSON as a NSString from NSData response
        NSString *json_string = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding];
    
        NSArray *statuses = [parser objectWithString:json_string error:nil];
    
        NSMutableArray * tempMutArray = [[[NSMutableArray alloc] init] autorelease];
        int i;
        for (i=0; i<[statuses count]; i++) {
                [tempMutArray addObject:[[statuses objectAtIndex:i] objectForKey:field]];
        }
    
        return [tempMutArray copy];
    
    }
    

    after that i call it in cell as following:

    //in viewDidLoad
    NSArray * homework = [self JSONPath:@"http://....." JSONField:@"assignment_title"];
    
    //In cellForRowAtIndexPath
    cell.textLabel.text = [homework objectAtIndex:indexPath.row];
    

    Thanks to all

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

Sidebar

Related Questions

I have a text area in my form which accepts all possible characters from
Does anyone know how can I replace this 2 symbol below from the string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a bunch of posts stored in text files formatted in yaml/textile (from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,

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.