ios - How do you send data between viewcontrollers that are in different storyboards -
here code in first viewcontroller.m file:
riskviewcontroller *riskvc = [[riskviewcontroller alloc] initwithnibname:nil bundle:[nsbundle mainbundle]]; riskvc.address1 = @"this data im trying send!"; uistoryboard *storyboard = [uistoryboard storyboardwithname:@"main" bundle: [nsbundle mainbundle]]; [self.navigationcontroller pushviewcontroller:[storyboard instantiateviewcontrollerwithidentifier:@"risk"] animated:yes];
here code in second viewcontroller.h file:
@interface riskviewcontroller : uiviewcontroller <uitextfielddelegate> @property (nonatomic, strong) nsstring * address1;
here code in second viewcontroller.m file. nsloging self.address1 null:
- (void)viewdidload { [super viewdidload]; nslog(@"addy1%@", self.address1); }
why self.address1 string null, should contain string sent, how fix data gets sent?
uistoryboard *storyboard = [uistoryboard storyboardwithname:@"main" bundle: [nsbundle mainbundle]]; riskviewcontroller *riskvc = [storyboard instantiateviewcontrollerwithidentifier:@"risk"] riskvc.address1 = @"this data im trying send!"; [self.navigationcontroller pushviewcontroller:riskvc animated:yes];
Comments
Post a Comment