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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:32:54+00:00 2026-05-28T02:32:54+00:00

I have a tableviewcontroller with data population it. I’m trying to get a new

  • 0

I have a tableviewcontroller with data population it. I’m trying to get a new details view to be pushed when the user taps on a cell. I can get the view to load, however the labels to show the data in more detail are not updated. Here is the code:

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{

[tableView deselectRowAtIndexPath:indexPath animated:YES];

SearchDetailViewController *controller = [self.storyboard  instantiateViewControllerWithIdentifier:@"searchDetailVC"];
Events *event = [events objectAtIndex:indexPath.row];

NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateStyle:NSDateFormatterLongStyle];
NSString *dateString = [dateFormatter stringFromDate:event.eventDate];

controller.title=event.eventName; //ONLY ONE THAT WORKS!


controller.eventName.text = event.eventName;
controller.eventAddress.text = event.eventAddress;
controller.eventDate.text = dateString;
controller.eventTime.text = event.eventTime;
controller.ratingView.image = [self imageForRating:event.eventRating];
controller.eventDistance.text = @"NOT YET IMPLEMENTED";

[self.navigationController pushViewController:controller animated:YES];
}

The only property that is set is the title of the NavigationController navbar. Am I doing something drastically wrong?

  • 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-28T02:32:55+00:00Added an answer on May 28, 2026 at 2:32 am

    You can’t pass data like this. ViewController.domainField is nil at that time because the view hasn’t loaded yet, and the label/TextField is created when the view loads (via a nib) and not as soon as the view controller object is created.

    This code can help you

    SearchDetailViewController.h
        #import <UIKit/UIKit.h>
        @interface SearchDetailViewController : UIViewController 
        {
    
            NSString*  eventNameString ;
            NSString* eventAddressString;
            ...........
            .............
    
        }
        @property (nonatomic,retain) NSString*  eventNameString ;
        @property (nonatomic,retain) NSString*  eventAddressString;
        ...............
        ...............
        @end
    
    
    SearchDetailViewController.m
    - (void)viewDidLoad
    {
         [super viewDidLoad];
         eventName.text=eventNameString;
         eventAddress.text=eventAddressString;
         ..........................
         ..........................
        eventNameString=[[NSString alloc]initWithString:@""];
    }
    
    
    TableView.m
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
    
    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    SearchDetailViewController *controller = [self.storyboard  instantiateViewControllerWithIdentifier:@"searchDetailVC"];
    Events *event = [events objectAtIndex:indexPath.row];
    
    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
    [dateFormatter setDateStyle:NSDateFormatterLongStyle];
    NSString *dateString = [dateFormatter stringFromDate:event.eventDate];
    
    controller.title=event.eventName; //ONLY ONE THAT WORKS!
    
    
    controller.eventNameString=[[NSString alloc]initWithString:event.eventName];
    controller.eventAddressString=[[NSString alloc]initWithString:eventAddress];
    ...............................
    ...............................
    ............
    
    [self.navigationController pushViewController:controller animated:YES];
    }
    

    Likewise, you have to pass all data from one view to another view – you can’t directly assign to controller.

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

Sidebar

Related Questions

I have got a tableViewController with one section and one cell. How can I
i have a tableviewcontroller and inside it i am trying loading data of the
I have a TableViewController with x rows. When the user taps on one row
I have an iPhone app with a tableviewcontroller. When you click a certain cell
I have two View Controllers: TableViewController (which is used as a modal view controller)
I try to do TableViewController and TableCell have an image. While the row can
I have a tableview where each cell is populated with dynamic data from an
Maybe a FAQ at this website. I have a TableViewController that holds a form.
Have you managed to get Aptana Studio debugging to work? I tried following this,
I have an app which got 4 TableViewController which each make an instance of

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.