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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:34:28+00:00 2026-05-15T22:34:28+00:00

I am having trouble getting my UITableViewController to reload/refresh the data. I have a

  • 0

I am having trouble getting my UITableViewController to reload/refresh the data.

I have a method which uses ASIHTTPRequest to call a URL and bring back some string data. I am trying to put this data into a cell of the table, but [self.tableview reloadData] is not working.

I was thinking that the ASIHTTPRequest completes its tasks on a separate thread, so I tried:

[self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];

which also did nothing.

How can I reload the data? I have been stuck on this for some time now.

Code:
MainViewController.h

#import <UIKit/UIKit.h>
@class ProductClass;
@interface MainViewController : UITableViewController {
 ProductClass *item;
}
@property (nonatomic, retain) ProductClass *item;
@end

MainViewController.m

#import "MainViewController.h"
#import "ASIHTTPRequest.h"
#import "ProductClass.h"

@implementation MainViewController
@synthesize item;

- (void) viewDidLoad {
 self.title = @"TableView Test";
 self.tableView.allowsSelection = NO;
 self.item = [[ProductClass alloc] init];
    [self callURL];
}

-(void)callURL {
    NSURL *url = [NSURL URLWithString:@"http://urlgoeshere.com"];
    ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
 [request setDelegate:self];
 [request startAsynchronous];
}


- (void)requestFinished:(ASIHTTPRequest *)request {
 //Grab the response
 NSString *responseString = [request responseString];
        //Put the result into the ProductClass item
 item.titleOfProduct = responseString;

    //This line shows that self.tableview does NOT have an address of 0x0
 NSLog(@"%@\n", self.tableView); 

    //Problem line!!!!!! 
    [self.tableView performSelectorOnMainThread:@selector(reloadData) withObject:nil waitUntilDone:NO];
    //The below lines also do nothing!!!!
 //[self.tableView reloadData];
 //[[self tableView] reloadData];
}

Anyone have any ideas??? I am at a total loss.

Cheers,
Brett

  • 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-15T22:34:29+00:00Added an answer on May 15, 2026 at 10:34 pm

    You don’t need the performSelectorOnMainThread – asihttprequest always calls the selectors on the main thread.

    Have you setup a datasource for the table? You need to setup at least some of the fields datasource, see:

    http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITableViewDatasource_Protocol/Reference/Reference.html

    At least cellForRowAtIndexPath and numberOfRowsInSection. There’s a tutorial here that may help:

    http://icodeblog.com/2008/08/08/iphone-programming-tutorial-populating-uitableview-with-an-nsarray/

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

Sidebar

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.