【发布时间】:2012-11-18 21:59:59
【问题描述】:
我还是 iPhone 编程的新手,并且已经研究了我的问题,但没有找到任何解决方案。
我已经设法关注ZBar SDK Integration tutorial,在标签控制器内最后有一个工作应用程序。
我想要做的是将结果移动到单独的 ViewController。
- (void) imagePickerController: (UIImagePickerController*) reader
didFinishPickingMediaWithInfo: (NSDictionary*) info
{
// ADD: get the decode results
id<NSFastEnumeration> results =
[info objectForKey: ZBarReaderControllerResults];
ZBarSymbol *symbol = nil;
for(symbol in results)
// EXAMPLE: just grab the first barcode
break;
ProductViewController *product = [self.storyboard instantiateViewControllerWithIdentifier: @"ProductView"];
product.resultImage = [info objectForKey: UIImagePickerControllerOriginalImage];
product.resultText = symbol.data;
[reader dismissModalViewControllerAnimated:YES];
[self presentModalViewController:product animated:YES];
}
我遇到的代码问题是产品视图控制器从未显示。
使用 Xcode 4.5、iOS 6 SDK。
【问题讨论】:
标签: ios storyboard xcode4.5 zbar-sdk uitabcontroller