AView.m
UIButton *btn = [[UIButton alloc]initWithFrame()];
[btn addTarget:self action:@selectior(perpareForSegue:sender:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:btn];
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
//I want to get destinationViewController of segue with identifier"toNextView"
// and then perform the segue
// Difficulties that I encounter is that I have a NSInvalidArgumentException
// Is that mean the view controller doesn't know the existence of the segue?
// I have connected two controller with a segue
}
我想用标识符“toNextView”获取segue的destinationViewController,然后执行segue我遇到的困难是我有一个NSInvalidArgumentException这是否意味着视图控制器不知道segue的存在?我已将两个控制器与 segue 连接起来。