I have one solution: just create a property or variable if necessary. For example:
@property (strong, nonatomic) UIStoryboard * storyboard1; @property (strong, nonatomic) UIStoryboard * storyboard2; ..... .m -(void)initMyStoryboards{ storyboard1 = [UIStoryboard storyboardWithName:@"storyboard1" bundle:nil]; storyboard2 = [UIStoryboard storyboardWithName:@"storyboard2" bundle:nil]; } -(void)launchViewFromS1{
another example:
-(void)launchMyView{ UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@"storyboard1" bundle:nil]; ViewController1 *myViewController =[storyboard instantiateViewControllerWithIdentifier:@"MainView"]; .... }
Anthony Mar 20 2018-12-12T00: 00Z
source share