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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T06:13:08+00:00 2026-06-06T06:13:08+00:00

The JSON that I am parsing can be found here ‘redacted’. I can correctly

  • 0

The JSON that I am parsing can be found here ‘redacted’.

I can correctly grab all of the objects from this JSON except notifications and devices.
I am having a lot of trouble being able to get the array of device dictionaries containing ‘deviceId’s. My code right now looks like this

dispatch_async(kBgQueue, ^{
    NSData* data = [NSData dataWithContentsOfURL:
                    iViuListOfCustomersURL];

    [self performSelectorOnMainThread:@selector(fetchedData:)
                          withObject:data waitUntilDone:NO];
});




- (void) fetchedData:(NSData *)responseData {
NSError* error;
NSDictionary* json;
    json = [NSJSONSerialization
                          JSONObjectWithData:responseData // 1

                          options:kNilOptions
                          error:&error]; 

    NSArray* customers = json; 


    for(int i = 0; i < customers.count ; i++){
        NSDictionary *customer = [customers objectAtIndex:i];
        cmsServer = [customer objectForKey:@"cmsServer"]; 
        iconUrl = [NSURL URLWithString:[customer objectForKey:@"iconUrl"]];
        wideLogo = [customer objectForKey:@"wideLogo"]; 
        customerNo = [NSNumber numberWithInt:[[customer objectForKey:@"customerNo"] intValue]];
        placeName = [customer objectForKey:@"placeName"];
        distance = [NSNumber numberWithFloat:[[customer objectForKey:@"distance"] floatValue]];
        placeId = [NSNumber numberWithInt:[[customer objectForKey:@"placeId"] intValue]];
        address = [customer objectForKey:@"address"];
        cmsName = [customer objectForKey:@"cmsName"]; 
        hasLocations = [NSNumber numberWithInt:[[customer objectForKey:@"hasLocations"]intValue]];
        isFavorite = [NSNumber numberWithInt:[[customer objectForKey:@"isFavorite"] intValue]];
        longitude = [NSNumber numberWithFloat:[[customer objectForKey:@"longitude"] floatValue]];
        latitude = [NSNumber numberWithFloat:[[customer objectForKey:@"latitude"] floatValue]];
        hasArtifacts = [NSNumber numberWithInt:[[customer objectForKey:@"hasArtifacts"]intValue]];

        // I have tried a number of things and this was what I had for the last try.
        devices = [NSArray arrayWithObject:[customer objectForKey:@"devices"]];
        NSLog(@"%@",devices.count);
    }

}

I am relatively new to objective-c and wanted to figure this out on my own but I have spent too much time on this issue and I cannot continue without these device IDs.

Thank you!

  • 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-06T06:13:09+00:00Added an answer on June 6, 2026 at 6:13 am

    I don’t know if it will make a difference but have you tried:

    devices = [NSArray arrayWithArray:[customer objectForKey:@"devices"]];
    

    The other thing you can try is going through the elements in it and adding them one by one into devices:

    for(DeviceObject *deviceObject in [customer objectForKey:@"devices"])
    {
      [devices addObject:deviceObject];
    }
    

    The other thing you can look into is the empty values you pass sometimes in your json.

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

Sidebar

Related Questions

I'm parsing JSON that is contained in an HTML element. Consider this markup: <div
I'm having some trouble parsing a JSON that I obtain from my DB to
I have a JSON feed that I'm parsing. Here's the following code samples: JSON
I could not find this anywhere. I fetch some JSON from an API that
I have created one application in j2me, I have used json parsing in that
i am doing jSon parsing in C# (ASP).The problem is that when the JSON
I'm have an action /json that returns json from the server. Unfortunately in IE,
I am using an API that outputs JSON objects with many attributes including sub-objects.
I'm returning a JSON using WCF and webHttpBinding so that it can be used
Really two questions: If I have a dictionary (that originally came from parsing a

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.