Note that there are some explanatory texts on larger screens.

plurals
  1. POprepare to segue pass data selector
    primarykey
    data
    text
    <p>I'm trying to pass data through through segues with this code:</p> <pre><code>- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segue.identifier isEqualToString:@"exerciseDetailDescription"]) { SoulExerciseDetailQuarViewController *destination = segue.destinationViewController; if ([destination respondsToSelector:@selector(setOverview:)]) { NSDictionary *overview = @{@"name" : [_exercise objectForKey:@"name"], @"longDescription" : [_exercise objectForKey:@"longDescription"]}; [destination setValue:overview forKey:@"overview"]; } } else if ([segue.identifier isEqualToString:@"exerciseDetailGear"]) { SoulExerciseDetailTriaViewController *destination = segue.destinationViewController; if ([destination respondsToSelector:@selector(setSelectedGearString:)]) { NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; NSString *selectedGearString = cell.detailTextLabel.text; [destination setValue:selectedGearString forKey:@"selectedGearString"]; } } else if ([segue.identifier isEqualToString:@"exerciseDetailCategory"]) { SoulExerciseDetailDuaViewController *destination = segue.destinationViewController; if ([destination respondsToSelector:@selector(setSelectedCategoryString:)]) { NSLog(@"Go"); NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow]; UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; NSString *selectedCategoryString = cell.detailTextLabel.text; [destination setValue:selectedCategoryString forKey:@"selectedCategoryString"]; } }} </code></pre> <p>So if it responds to the setter that is found in the segue's destination it allows the transfer of data.</p> <p>The weird thing is that the first one responds correctly but in the second and third, it says that the destination view controller is not responding to those setter</p> <p>For example in the third the nslog is not shown.</p>
    singulars
    1. This table or related slice is empty.
    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.
 

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