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

  • Home
  • SEARCH
  • 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 4091930
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:25:41+00:00 2026-05-20T19:25:41+00:00

I am trying to create an iphone application that reads a json feed and

  • 0

I am trying to create an iphone application that reads a json feed and I am having some trouble updating a TableView.

This is my TableViewController header file:

@interface LiveNewsController : UITableViewController <UITableViewDelegate, UITableViewDataSource>{

NSMutableData *responseData;
NSMutableArray *articleArray;

UITableView *tblView;

}

-(void) refreshPressed: (id)sender;

@property (nonatomic, retain) IBOutlet UITableView *tblView;

@end

These are some parts of my TableViewController implementation file:

@implementation LiveNewsController

@synthesize tblView;

-(id) init {
    if(self = [super init])
    {
        self.title = @"Live News";
    }
    return self;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    NSLog(@"I am here %d",[articleArray count]);
    return [articleArray count];
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
       cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

    NSLog(@"cellForRowAtIndexPath called. Data size %d", [articleArray count]);


    NSUInteger row = [indexPath row];
    cell.textLabel.text = [articleArray objectAtIndex:row];

    return cell;
}

-(void) refreshPressed: (id)sender
{
    NSLog(@"Reload Pressed. Data size: %d", [articleArray count]);
    [tblView reloadData];
}

Here is a screenshot of my .xib file with the connections:
IB Screenshot

So the main idea is the following:

  1. Fetch articleArray
  2. When refresh is pressed update view (the data is being fetched correctly but the snippet doesn’t show it here)

numberOfRowsInSection and CellForRowAtIndexPath are only being called once when the view loads but nothing happens when I press the reload button.

I checked tblView and it is nil. I did some research and read that this is usually caused by some erroneous connections in the .xib file but I have triple checked that and I can’t seem to pinpoint the problem.

Any help is appreciated,

Thanks!

  • 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-20T19:25:42+00:00Added an answer on May 20, 2026 at 7:25 pm

    You don’t need to declare the UITableView tblView, the UITableViewController has already one (and therefore all subclasses too).
    Just try [self.tableView reloadData];.

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

Sidebar

Related Questions

No related questions found

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.