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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:23:39+00:00 2026-05-28T14:23:39+00:00

I am getting this data from JSON web services List ARRAY: ( { assets

  • 0

I am getting this data from JSON web services

List ARRAY: (
    {
    assets =         (
                    {
            identity = 34DL3611;
            systemId = 544507;
        },
                    {
            identity = 34GF0512;
            systemId = 5290211;
        },
                    {
            identity = 34HH1734;
            systemId = 111463609;
        },
                    {
            identity = 34HH1736;
            systemId = 111463622;
        },
                    {
            identity = 34YCJ15;
            systemId = 294151155;
        }
    );
    identity = DEMO;
    systemId = 4921244;
})

By using this code:

NSArray *list =[NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];

NSLog(@"Response data: %@", responseString);

NSLog(@"List ARRAY: %@", list);

NSDictionary *dict = [list objectAtIndex: 0];

NSMutableArray *vehicleGroups = [dict objectForKey:@"identity"];

NSLog(@"Vehicle Groups: %@", vehicleGroups);

Here is the picker code I am using:

    -(NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView{
return 1;}

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent :(NSInteger)component { 
return [vehicleGroups count];}

-(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component{return nil;}

-(void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component{
 }

The application crashes at the line

return [vehicleGroups count];

delegate method numberOfRowsInComponent of pickerView. I am not getting that – why I am facing this issue?

//Code////

    NSArray *list =[NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];

NSLog(@"Response data: %@", responseString);

NSLog(@"List ARRAY: %@", list);

NSDictionary *dict = [list objectAtIndex: 0];

vehicleList = [dict objectForKey: @"assets"];

self.vehicleGroups = [[NSMutableArray alloc] init];

vehicleGroups = [dict objectForKey:@"identity"];

NSLog(@"Vehicle Groups: %@", vehicleGroups);

NSString *identity = [dict objectForKey: @"identity"];

NSString *systemid = [dict objectForKey:@"systemId"];

self.listVehicles = [[NSMutableArray alloc] init];

self.listVehiclesID =[[NSMutableArray alloc]init];

NSLog(@"GroupOfVehicles: %@", groupOfVehicles);

for (NSUInteger index = 0; index < [vehicleList count]; index++) {

    itemDict = [vehicleList objectAtIndex: index];

    [self.listVehicles addObject:[itemDict objectForKey:@"identity"]];

    [self.listVehiclesID addObject:[itemDict objectForKey:@"systemId"]];
}

NSLog(@"Group Name: %@", identity);

NSLog(@"Assets: %@", listVehicles);

NSLog(@"Assets System ID: %@", listVehiclesID);

NSLog(@"GroupSystemID: %@", systemid);
  • 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-28T14:23:40+00:00Added an answer on May 28, 2026 at 2:23 pm

    Answering my own question guide others if they face the same problem, Actually what I have done here to get the required array for identity: DEMO is as follows:

    vehicleGroups =[NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];
    
    NSLog(@"Response data: %@", responseString);
    
    NSLog(@"List ARRAY: %@", vehicleGroups);
    
    NSDictionary *dict1 = [vehicleGroups objectAtIndex: 0];
    
    NSString *identity1 = [dict objectForKey: @"identity"];
    
    NSLog(@"dictNEW: %@", dict1);
    
    groupOfVehicles = [[NSMutableArray alloc] init];
    for (NSUInteger index = 0; index < [vehicleGroups count]; index++) {
    
        itemDict = [vehicleGroups objectAtIndex: index];
    
        [groupOfVehicles addObject:[itemDict objectForKey:@"identity"]];
    }
    
    NSLog(@"Group Name NEW: %@", identity1);
    
    NSLog(@"Groups NEW: %@", groupOfVehicles);
    

    After using that code I have properly got the array for my required data

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

Sidebar

Related Questions

I am getting this data from JSON web services [{identity:DEMO,assets:[{identity:34DL3611,systemId:544507},{identity:34GF0512,systemId:5290211},{identity:34HH1734,systemId:111463609},{identity:34HH1736,systemId:111463622},{identity:34YCJ15,systemId:294151155}],systemId:4921244}] I am using this
Im getting my data from a web service and loads to a list view.
I keep on getting this error error: expected specifier-qualifier-list for core data code im
I am having trouble getting some data from a JSON object which I have
Hello friends i am having problem in parsing jSON web services data I have
I'm trying to grab some JSON data from a web service using JSON.Net. The
I am getting this JSON string from an ASP.Net webservice: {d:{Table:[{col1:123,col2:name,col3:name,col4:100,col5:\/Date(1153033200000)\/},{col1:123,col2:name,col3:name,col4:101,col5:\/Date(1153033200000)\/},{col1:123,col2:name,col3:name,col4:102,col5:\/Date(1153033200000)\/}]}} In my jQuery
I am getting this error: Data at the root level is invalid. Line 1,
I am getting an error when I run this query because the data type
Anyone getting this error when using the new free chart controls MS bought from

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.