我正在尝试从不同的类(即 NSObject 类)调用 performSegueWithIdentifier,我收到此错误:
由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:
'Receiver (<DerinlikView: 0x95b1ac0>) has no segue with identifier 'DerinlikToPali''
我的代码是:
类 1(NSObject):
DerinlikView *derinlik = [DerinlikView alloc];
[derinlik performSegue];
类 2(UIViewController):
- (void) performSegue
{
[self performSegueWithIdentifier:@"DerinlikToPali" sender:self];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ( [[segue identifier] isEqualToString:@"DerinlikToPali"] )
{
Palinolojik *pali = segue.destinationViewController;
}
}