Note that there are some explanatory texts on larger screens.

plurals
  1. POTrouble passing information through segue
    primarykey
    data
    text
    <p>Alright. I'm having trouble passing data through a segue from one UITableViewController to another. The proper information does not load. Without a bunch of endless talk about the setup, here goes:</p> <p>On the upper (passing) viewController side:</p> <pre><code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"deriv"]) { NSIndexPath *indexPath = [self.tableView2 indexPathForSelectedRow]; DerivationController *destViewController = segue.destinationViewController; destViewController.derivationName = [equationsList2 objectAtIndex:indexPath.row]; } </code></pre> <p>On the receiving viewController side:</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *simpleTableIdentifier = @"derivCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier]; } cell.textLabel.text = [derivations objectAtIndex:indexPath.row]; cell.detailTextLabel.text = [details objectAtIndex:indexPath.row]; return cell; } </code></pre> <ul> <li><p>equationsList2 is a list of equations in an NSArray instance. Depending on which one is selected, cell.textLabel and cell.detailTextLabel are set accordingly from NSArrays "derivations" and "details".</p></li> <li><p>The declaration for DerivationController.h is on the passing viewController's header list.</p></li> <li><p>No errors are thrown.</p></li> </ul> <p>Any ideas?</p> <p>Code for setting 'derivations' and 'detail':</p> <pre><code>if ([_derivationName isEqualToString:@"Momentum-Velocity"]) { // Equation 1: derivations = [NSArray arrayWithObjects: @"Momentum", @"Mass", @"Velocity", nil]; details = [NSArray arrayWithObjects: @"Momentum units in kg ∙ m/s", @"Mass units in kilograms (kg)", @"Velocity units in meters/second (m/s)", nil]; </code></pre>
    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