Hey all,
I am using the new storyboard feature. Basically, I have a table, and when you click on a cell, depending on the value held in one of my methods, I want to display a specific view. There are 4 views associated with this table cell of the table. And each display condiitionally based on a value of one of my methods declared and initialized in the table view class. Problem is I am not sure how to set up the segue, since they can only point to one view.
For example, typically you would do some setup in the prepareForSegue method:
The problem in my situation is that destinationViewController could be more than one view controller depending on the value of a method.
thanks for response.
I am using the new storyboard feature. Basically, I have a table, and when you click on a cell, depending on the value held in one of my methods, I want to display a specific view. There are 4 views associated with this table cell of the table. And each display condiitionally based on a value of one of my methods declared and initialized in the table view class. Problem is I am not sure how to set up the segue, since they can only point to one view.
For example, typically you would do some setup in the prepareForSegue method:
Code:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Make sure we're referring to the correct segue
if ([[segue identifier] isEqualToString:@"ShowSelectedMovie"]) {
// Get reference to the destination view controller
RemoteControlViewController *vc = [segue destinationViewController];
// get the selected index
NSInteger selectedIndex = [[self.tableView indexPathForSelectedRow] row]; //this is where we set a value to selectedIndex method
// Pass the name and index of our film
[vc setSelectedItem:[NSString stringWithFormat:@"%@", [units objectAtIndex:selectedIndex]]];
[vc setSelectedIndex:selectedIndex];
}
}
The problem in my situation is that destinationViewController could be more than one view controller depending on the value of a method.
thanks for response.