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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T22:53:14+00:00 2026-06-04T22:53:14+00:00

I have following JSON file to parse: [ { name: kkkk, empid: 55628, address:

  • 0

I have following JSON file to parse:

[
{
    "name": "kkkk",
    "empid": "55628",
    "address": "mumbai",
    "mobile": "9528558"
},
{
    "name": "xtreme",
    "empid": "20",
    "address": "stripes",
    "mobile": "9689597"
},
{
    "name": "xtreme",
    "empid": "20",
    "address": "stripes",
    "mobile": "9689999597"
},
{
    "name": "xtreme",
    "empid": "20",
    "address": "stripes",
    "mobile": "9689999597"
},
{
    "name": "xtreme",
    "empid": "20",
    "address": "stripes",
    "mobile": "9689597"
},
{
    "name": "xtreme",
    "empid": "20",
    "address": "stripes",
    "mobile": "9689999597"
},
{
    "name": "xtreme",
    "empid": "20",
    "address": "stripes",
    "mobile": "9689999597"
},
{
    "name": "xtreme",
    "empid": "20",
    "address": "stripes",
    "mobile": "9689999597"
},
{
    "name": "xtreme",
    "empid": "20",
    "address": "stripes",
    "mobile": "96897"
},
{
    "name": "vx",
    "empid": "96",
    "address": "addre",
    "mobile": "9689999596"
},
{
    "name": "vxx",
    "empid": "96",
    "address": "addre",
    "mobile": "968999"
},
{
    "name": "vx",
    "empid": "96",
    "address": "addre",
    "mobile": "9699596"
},
{
    "name": "vxertdrt",
    "empid": "96",
    "address": "addre",
    "mobile": "968996"
},
{
    "name": "vx",
    "empid": "96",
    "address": "addre",
    "mobile": "999596"
}

]

I have following code for parsing:

 SBJSON *parser=[[SBJSON alloc]init];
array=[parser objectWithString:firstParseData];
NSString *secondParseData=[array objectAtIndex:0];
NSLog(@"name=%@",secondParseData);

by this code i am getting the following output in string format:

 name={
address = mumbai;
empid = 55628;
mobile = 9525878558;
name = kkkk;

}

But i want the output in form of employee object. How can i made the the employee object from the json??

  • 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-04T22:53:16+00:00Added an answer on June 4, 2026 at 10:53 pm

    You must have an Employee class with a constructor. Then you can do something like this. You don’t need to create a SBJson parser object. You can use it directly on the NSString, that is a beauty of SBJson.

    NSString * data = @"[
    {
        "name": "kkkk",
        "empid": "55628",
        "address": "mumbai",
        "mobile": "9528558"
    },
    ...
    {
        "name": "vx",
        "empid": "96",
        "address": "addre",
        "mobile": "999596"
    }
    ]";
    
    // Get an array with all the employees inside
    NSArray *myArray = [data JSONValue];
    
    // Pick out the first employee
    NSDictionary *firstEmployee = myArray[0];
    
    // Create an object for him
    Employee *firstEmployeeObject = [[Employee alloc] initWithAddress:[firstEmployee objectForKey:@"address"] andEmpID:[firstEmployee objectForKey:@"empid"] andMobile:[firstEmployee objectForKey:@"mobile"] andName:[firstEmployee objectForKey:@"name"]];
    

    Don’t forget to release your objects if you are not using ARC.

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

Sidebar

Related Questions

I have following json file. { id: 100001740605903, name: Mike Watshan, first_name: Mike, last_name:
I have the following json file: { segments: { externalId: 123, name: Tomas Zulberti,
I have the following json code file named: sections.json { section1: { priority: 1,
I have a configuration file in the following JSON format: { key1: value1, key2:
I have the following JSON String { name:Product, properties: { id: { type:number, description:Product
I have the following JSON string (from wikipedia http://en.wikipedia.org/wiki/JSON ) { name:Product, properties: {
I have the following JSON that I want to parse into C#. I am
I need to parse json object for this url I have used following code
I have the following JSON in a file menu.txt : [{ title:About, url:/about, nodes:[
I have the following JSON in a file list.txt : { bgates:{first:Bill,last:Gates}, sjobs:{first:Steve,last:Jobs} }

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.