I have a simple master/detail tableview. In order to get my selection in the master to the detail view, I use the following code to set a label (lTest) in the detail view.
However, it seems that this code is run before/ on a different view, since it does not return an error, but the value of lTest is not changed (not visible on screen after the segue).
(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"showDetail"]) {
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
ViewController *Targetview = segue.destinationViewController;
Targetview.lTest.text=[NSString stringWithFormat:@"Row %d",indexPath.item];
}
}
How can I change the label in the other view?