ios5 - How can I pass a variable through a segue? -
is possible pass value of double (for example) through segue? given sample code, i'm trying pass value of uistepper (a double) through segue view. know have declare double on other controller, i'm not sure if possible. have declare in other view controller make 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 add classlength
property in home_v1_viewcontroller
class:
header file (.h):
@property (nonatomic) double classlength;
implementation file (.m):
@synthesize classlength;
Comments
Post a Comment