Is it possible to pass the value of a double (for example) through a Segue? Given the sample code, I’m trying to pass the value of a UIStepper (a double) through the Segue to another view. I know I have to declare the double on the other controller, but I’m not sure if this is even possible. What do I have to declare in the other View Controller to make this work?
Thanks in advance.
-PaulS.
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"home2Segue"])
{
double classLength = stepperClassTime.value;
home_1_ViewController *vc = (home_1_ViewController *)[segue destinationViewController];
vc.classLength = classLength;
}
}
That should work fine if you add
classLengthas a property in yourhome_v1_ViewControllerclass:Header file (.h):
Implementation file (.m):