Im running a function under didFinishPickingMediaWithInfo but how can i render another viewController after the function finish
- (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];
}];
}
i tried adding
UIViewController *newTopViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"rootCarta"];
[reader presentViewController:newTopViewController animated:YES completion:nil];
after
[reader dismissViewControllerAnimated:YES completion:^{
[self procesarCheckInConQR:qr];
}];
and the view is rendered, but data from [self procesarCheckInConQR:qr]; isnt ready yet
Update: Instead of dismiss i present the new view controller, but i still dont have data from procesarCheckInConQR:qr
UIViewController *newTopViewController = [self.storyboard instantiateViewControllerWithIdentifier:@"rootCarta"];
[reader presentViewController:newTopViewController animated:YES completion:^{
[self procesarCheckInConQR:qr];
}];