Is this the correct way to write a prep for a segue method, if you have three buttons, each of which segue to different views.
Yes, the segues are named as you see them as string below.
Yes, the segues are named as you see them as string below.
Code:
- (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"AnswerA"])
{
ContentAViewController *cavc = [segue destinationViewController];
cavc.currentContent = _currentContent;
} else if ([segue.identifier isEqualToString:@"AnswerB"])
{
ContentBViewController *cbvc = [segue destinationViewController];
cbvc.currentContent = _currentContent;
} else if ([segue.identifier isEqualToString:@"AnswerC"])
{
ContentCViewController *ccvc = [segue destinationViewController];
ccvc.currentContent = _currentContent;
}
}