Note that there are some explanatory texts on larger screens.

plurals
  1. POTableViewController not going to next page
    primarykey
    data
    text
    <p>So I have a table view controller with multiple items. Everything was working so I left that alone, and started to work on other things in my project. When I finished doing other hints in my project and came back to working on my TableViewController, it wasn't working. When I click on an item, it does not go to the next page. </p> <p>In PhotosTableViewController.m I have this:</p> <pre><code>-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"ShowPage"]) { DisplayViewController *dvc = [segue destinationViewController]; NSIndexPath *path = [self.tableView indexPathForSelectedRow]; Photo *c = [photos objectAtIndex:path.row]; [dvc setCurrentPhoto:c]; } } - (void)viewDidLoad { [super viewDidLoad]; // I load all my objects in my array here } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { //6 // Return the number of sections. return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { // Return the number of rows in the section. return [photos count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"PhotoCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; // Configure the cell... Photo *current = [photos objectAtIndex:indexPath.row]; [cell.textLabel setText:[current name]]; NSString *details = [current notes]; if ([indexPath section] == 0) { [[cell detailTextLabel] setText:details]; } else{ [[cell detailTextLabel] setText:@"it's not working"]; } NSString *imageFile = [[NSBundle mainBundle] pathForResource:@"masjid" ofType:@"png"]; UIImage *myImg = [[UIImage alloc] initWithContentsOfFile:imageFile]; [[cell imageView] setImage:myImg]; return cell; } </code></pre> <p>In my DisplayViewController.m I have this:</p> <pre><code>- (void)viewDidLoad { [super viewDidLoad]; UIImage *image = [UIImage imageNamed:[currentPhoto filename]]; [self.currentImage setImage: image]; [self setTitle:[currentPhoto name]]; [detailsLabel setText:[currentPhoto notes]]; } - (void)viewDidUnload { [self setCurrentImage:nil]; [self setDetailsLabel:nil]; [self setCurrentPhoto:nil]; [super viewDidUnload]; // Release any retained subviews of the main view. } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } </code></pre> <p>So I figure the problem occurred when I was working on other problems in my project, and not paying attention to my table view controller. I have dissected the code in and out and have no solution. I'm sorry for putting a crud ton of code to look at, but as far as I am concerned, I have done my best and I need to move on.</p> <p>All help is appreciated, thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload