Поэтому я использую стороннюю библиотеку для сканирования штрих-кодов - shopavvy.То, что я пытаюсь сделать, это показать новый экран со всеми отсканированными штрих-кодами после того, как сканер будет закрыт.Я сделал (что мне показалось довольно простым) следующее, но не получил новый экран, а вернулся к исходному экрану после того, как сканер был закрыт.1004 * Это в моем главном контроллере вида:
- (void) scannerViewController:(SKScannerViewController *)scanner didRecognizeCode:(SKCode *)code {
NSLog(@"didRecognizeCode = %@", code.rawContent);
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
[self dismissModalViewControllerAnimated:YES]; //We're done scanning barcodes so we should dismiss our modal view controller.
_codeInfoLabel.text = code.rawContent;
[self showResults:code.rawContent];
}
Я вхожу в этот метод и он выполняется, но ничего не происходит.
- (void) showResults: (NSString *) barcode {
Results *resultsViewController = [[Results alloc] initWithNibName:nil bundle:nil];
resultsViewController.tempBarcode = barcode;
UINavigationController *resultsNavigationController = [[UINavigationController alloc] initWithRootViewController:resultsViewController];
resultsNavigationController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentModalViewController:resultsNavigationController animated:YES];
}