想知道如何解决此错误。
我会
QRReader = [ZBarReaderViewController new];
[self presentViewController:QRReader animated:YES completion:nil];
在customoverlay中我有一个按钮,可以调用
[helpButton addTarget:self action:@selector(goToTips) forControlEvents:UIControlEventTouchUpInside];
-(void)goToTips
{
[QRReader performSegueWithIdentifier:@"scannerToTips" sender:self];
}
但是当我按下按钮时我会收到此错误
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Receiver (<ZBarReaderViewController: 0x3c5350>) has no segue with identifier 'scannerToTips''
答案 0 :(得分:1)
好的,代码存在一些问题......
所以对seque的正确调用将是:
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
ZBarReaderViewController *QRReader = [segue destinationViewController];
// So to hold a reference and pass any data
}
但在你的情况下,我猜你没有使用segue ...... 所以像这样的代码就可以了:
[helpButton addTarget:self action:@selector(goToTips) forControlEvents:UIControlEventTouchUpInside];
-(void)goToTips
{
QRReader = [ZBarReaderViewController new];
[self presentViewController:QRReader animated:YES completion:nil];
}
我希望这有助于......