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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:14:35+00:00 2026-05-27T17:14:35+00:00

I have a page that contains a tableview – and a textfield and button

  • 0

I have a page that contains a tableview – and a textfield and button that sends a zip code to a PHP page and returns JSON data. I am not able to populate the table view with the returned data. The NSLog shows the data is being returned, but the table remains blank. No errors.
Code:

- (IBAction) searchzip: (id) sender
{
NSString *post = [NSString stringWithFormat:@"zip=%@", zipField.text];
NSString *hostString =     @"https://www.mysite.com/searchzip.php?";

// Append string and add percent escapes
hostString = [[hostString stringByAppendingString:post] stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *hostURL = [NSURL URLWithString:hostString];
NSString *jsonString = [[NSString alloc] initWithContentsOfURL:hostURL];
self.zipArray = [jsonString JSONValue]; 
NSLog(@"%@", zipArray);
[jsonString release];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section    {
return [zipArray count];
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath {
NSDictionary *infoDictionary = [self.zipArray objectAtIndex:indexPath.row];
static NSString *Prospects = @"agencyname";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:Prospects];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:Prospects]   autorelease];
}

// setting the text
cell.text = [infoDictionary objectForKey:@"agencyname"];    
self.navigationItem.title = @"Zip Search";

// Set up the cell
return cell;

}

Header File:

@interface SearchZipViewController : UITableViewController{
NSMutableArray *zipArray;
IBOutlet UITextField *zipField;
IBOutlet UIButton *searchButton;
}
@property (nonatomic, retain) NSMutableArray *zipArray;
@property (nonatomic, retain) UITextField *zipField;
@property (nonatomic, retain) UIButton *searchButton;
- (IBAction) searchzip: (id) sender;
@end
  • 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-27T17:14:36+00:00Added an answer on May 27, 2026 at 5:14 pm

    I believe the basic issue is that you are trying to build a composite view (textfield, button and tableview) and use a UITableViewController as the controller. It’s been cited here on SO and elsewhere that this is basically a no-go. Instead, try something like:

    @interface SearchZipViewController : UIViewController<UITableViewDelegate, UITableViewDataSource> {
        IBOutlet UIButton* searchButton;
        IBOutlet UITextField* zipField;
        IBOutlet UITableView* tableView;
    }
    
    @end
    

    then wire the UITableView in IB to the tableView ivar in the File’s Owner — it appears from your comments about that you were attempting to wire the table view element in the composite view to the File’s Owner, a UIViewController — not what you want.

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

Sidebar

Related Questions

I have an aspx page that contains a checkbox, and a button. The button
I have a page that contains a textbox and button, when the user clicks
I have a page that that contains a User Control and a submit Button.
i have a website page that contains only data of which one field gives
I have a page that contains a user control that is just a personalized
In a web application, I have a page that contains a DIV that has
I have a master page that contains an ASP.NET server side Menu control (System.Web.UI.WebControls.Menu)
I would like to have an aspx page that contains something like.... <form id=form1
I have an ASP.Net page that contains a <div> with an <img> tag within.
I have an ASP.Net 2.0 page that contains two UpdatePanels. The first panel contains

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.