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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:10:16+00:00 2026-05-22T17:10:16+00:00

I have UITableViewCell which, when clicked displays a UIView loaded from a .xib file.

  • 0

I have UITableViewCell which, when clicked displays a UIView loaded from a .xib file. When I click the cell the view is successfully displayed however the data I want to display in the view elements won’t display.

Code:

 - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
 // Navigation logic
 NSLog(@"didSelectRowAtIndexPath");

 //Initialize a UIView that contains all the elements required to display the data
 EventDescriptionView *dView = [[EventDescriptionView alloc] init];
 //Set the data in the elements to the data contained in the xml
 //Set up the cell
 int storyIndex = indexPath.row;
 [[dView name] setText:[[stories objectAtIndex: storyIndex] objectForKey: @"title"]];
 [[dView date] setText:[[stories objectAtIndex: storyIndex] objectForKey: @"date"]];
 NSLog(@"Index: %d", storyIndex);
 [[dView image] setImage:[images objectAtIndex:storyIndex]];
 //Display the UIView
 [UIView beginAnimations:nil context:nil];

 [UIView setAnimationDuration:0.5];

 [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft  forView:self.view cache:YES];

 [self.view addSubview:dView.view];

 [UIView commitAnimations];

}

I can see the lines:

[[dView name] setText:[[stories objectAtIndex: storyIndex] objectForKey: @"title"]];
 [[dView date] setText:[[stories objectAtIndex: storyIndex] objectForKey: @"date"]];
 NSLog(@"Index: %d", storyIndex);
 [[dView image] setImage:[images objectAtIndex:storyIndex]];

Aren’t recognising the dView elements and therefore successfully setting the data, but I don’t understand how to get round this?

Thanks,

Jack

  • 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-22T17:10:17+00:00Added an answer on May 22, 2026 at 5:10 pm

    The problem seems to be with this line.

    int storyIndex = [indexPath indexAtPosition: [indexPath length] - 1];
    

    This seems alien to a UITableView object as they map to rows and sections. Since I am expecting stories to map to the current row, I think your storyIndex should be –

    int storyIndex = indexPath.row;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom UITableViewCell which I created in Interface Builder. I am successfully
I have a custom UITableViewCell which is part of a navigation controller. The cell
I have an events app which gets events data from sqlite database and displays
I have a simple table view which I have built using an example from
I have a custom UITableViewCell which fills the cell with a background PNG and
I have a subclassed UITableViewCell named AccountView which contains an UIActivityIndicatorView. Each cell is
I have a UITableView in which each UITableViewCell having a UIView on them and
I have an UIImageView in my UITableViewCell which is not being displayed. I get
I have customized uitableViewcell in which each cell show four data which are related
I have a custom UITableViewCell which contains several UIButtons. Each button's frame position is

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.