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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:45:13+00:00 2026-05-15T10:45:13+00:00

I am loading json into a list of objects I am adding to a

  • 0

I am loading json into a list of objects I am adding to a NSMutableArray which seems to be working fine except for the fact that I can’t seem to keep the array around to access later.

This is my .h:

@interface ClientController : UITableViewController {
    NSMutableData *responseData;
    NSMutableArray *ClientList;
}

@property (nonatomic, retain) NSMutableArray *ClientList;

In my .m I add:

@synthesize ClientList;

later I have a method that populates it (Client is a class I have as well):

/* some code that parses the Json */
for (int i = 0; i < [items count]; i++) 
        {
            Client* client = [[Client alloc] init];
            client.CompanyName = [[items objectAtIndex:i] objectForKey:@"CompanyName"]; 
            client.ClientID = [[items objectAtIndex:i] objectForKey:@"ClientID"];           

            [ClientList addObject:client];

            NSLog(@"CompanyName: %@\n", client.CompanyName);
            [client release];
        }

Console shows me that is is working properly because I see the data I expect BUT when I do this I get a null value:

NSLog(@"Clients Count: %@\n", [ClientList count]);

I need to loop though this to build my table – so what am I missing here?

  • 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-15T10:45:14+00:00Added an answer on May 15, 2026 at 10:45 am

    Gotta initialize your ClientList, thusly:

    -(void)viewDidLoad
    {
      self.ClientList = [NSMutableArray array];
    }
    

    Otherwise self.ClientList is a nil pointer, and as a result, [self.ClientList addObject:] is a silent no-op, as is [self.ClientList count].

    By the way, the name “clientList” would probably be preferable. We like our variables to start lower-cased in Obj-C.

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

Sidebar

Ask A Question

Stats

  • Questions 545k
  • Answers 545k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer An import statement like import foo.bar.baz first imports foo, then… May 17, 2026 at 8:45 am
  • Editorial Team
    Editorial Team added an answer As I understand it, your issue is that you want… May 17, 2026 at 8:45 am
  • Editorial Team
    Editorial Team added an answer You could apply CASCADING DELETES to your foreign key from… May 17, 2026 at 8:44 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am loading a list of images into a div with the following bit
So I am loading some Json that is transformed from RSS beforehand. This RSS
I am loading JSON data to my page and using appendTo() but I am
When loading XML into an XmlDocument, i.e. XmlDocument document = new XmlDocument(); document.LoadXml(xmlData); is
I'm dynamically loading user controls adding them to the Controls collection of the web
I'm loading a SQL Server 2000 database into my new SQL Server 2005 instance
My usual way of working on web development is to split the project into
I have a page that displays data from an object. I'm loading the object
When loading a page for the first time (!IsPostback), I am creating a button
Try loading this normal .jpg file in Internet Explorer 6.0. I get an error

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.