Note that there are some explanatory texts on larger screens.

plurals
  1. POtable view is not pushing to the new view when cell is touched
    text
    copied!<p>I'm trying to navigate from a table view, to anther UIViewController. I control-dragged my TableCell in the new UIViewController. Then I typed in the following code.</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; // Configure the cell... if (cell == nil) { cell = [[ UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; } if ([indexPath section] == 0) { Tips *tipy = [arr objectAtIndex:indexPath.row]; cell.textLabel.text = [tipy tipdescription]; cell.detailTextLabel.text = [tipy.tipnumber stringValue]; NSString *imagefile = [[ NSBundle mainBundle] pathForResource:@"unlikeico" ofType:@"png"]; UIImage *image = [[UIImage alloc] initWithContentsOfFile:imagefile]; [[cell imageView]setImage:image]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } else { Tips *tipy = [arr2 objectAtIndex:indexPath.row]; cell.textLabel.text = [tipy tipdescription]; cell.detailTextLabel.text = [tipy.tipnumber stringValue]; NSString *imagefile = [[ NSBundle mainBundle] pathForResource:@"likeico" ofType:@"png"]; UIImage *image = [[UIImage alloc] initWithContentsOfFile:imagefile]; [[cell imageView]setImage:image]; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; } return cell; } - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{ if ([segue.identifier isEqualToString:@"showtext"]) { DisplayViewController *dvc = [segue destinationViewController]; NSIndexPath *path = [self.tableView indexPathForSelectedRow]; Tips *tipy = [arr2 objectAtIndex:[path row]]; [dvc setCurrenttext:tipy]; } } </code></pre> <p>The table will display the data, but does not move to the new UIViewController. Xcode does not show any warnings or errors. What's the problem here?</p>
 

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