【发布时间】:2013-11-12 18:46:22
【问题描述】:
我在 didFinishPickingMediaWithInfo 下运行一个函数,但是函数完成后如何渲染另一个 viewController
- (void) imagePickerController: (UIImagePickerController*) reader
didFinishPickingMediaWithInfo: (NSDictionary*) info
{
id<NSFastEnumeration> results =[info objectForKey: ZBarReaderControllerResults];
NSString *qr;
for (ZBarSymbol *symbol in results) {
NSLog(@"Resultado: %@", symbol.data);
qr = symbol.data;
}
[reader dismissViewControllerAnimated:YES completion:^{
[self procesarCheckInConQR:qr];
}];
}
我尝试添加
UIViewController *newTopViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"rootCarta"];
[reader presentViewController:newTopViewController animated:YES completion:nil];
之后
[reader dismissViewControllerAnimated:YES completion:^{
[self procesarCheckInConQR:qr];
}];
视图被渲染,但数据来自 [self procesarCheckInConQR:qr];还没准备好
更新: 我没有解雇我,而是展示了新的视图控制器,但我仍然没有来自的数据 procesarCheckInConQR:qr
UIViewController *newTopViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"rootCarta"];
[reader presentViewController:newTopViewController animated:YES completion:^{
[self procesarCheckInConQR:qr];
}];
【问题讨论】:
标签: ios objective-c zbar-sdk zbar