Hello I have two story boards. Lets call them storyboard1 and storyboard2.
I want to pass data from storyboard1 to storyboard2, and here is my code.
In storyboard1:
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"IndicesDetail" bundle:nil];
DataIntegrationIndexDetailViewController *cl = (DataIntegrationIndexDetailViewController *)[sb instantiateViewControllerWithIdentifier:@"indicesDetail"];
cl.transitioningDelegate = self;
[self presentViewController:cl animated:YES completion:nil];
and in storyboard2, I called the value something like this:
NSLog(@"sel index:%@",_delegate.selectedIndexCode);
the result I got is null.
I also try like this, in storyboard1:
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"IndicesDetail" bundle:nil];
DataIntegrationIndexDetailViewController *cl = (DataIntegrationIndexDetailViewController *)[sb instantiateViewControllerWithIdentifier:@"indicesDetail"];
cl.selectedIndex = @"test";
[self presentViewController:cl animated:YES completion:nil];
But it's give me an error.
So how I pass data from one storyboard to another storyboard?
Try:
[self.navigationController pushViewController:cl animated:YES];
instead of [self presentViewController]
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments